Remove unnecessary casting
This commit is contained in:
parent
48ae9a2a33
commit
52280e9823
6 changed files with 14 additions and 14 deletions
|
|
@ -112,9 +112,9 @@ impl WinitState {
|
|||
.get::<RefCell<OutputConfig>>()
|
||||
.unwrap()
|
||||
.borrow_mut();
|
||||
if dbg!(config.mode.0) != dbg!((size.w as i32, size.h as i32)) {
|
||||
if dbg!(config.mode.0) != dbg!((size.w, size.h)) {
|
||||
if !test_only {
|
||||
config.mode = ((size.w as i32, size.h as i32), None);
|
||||
config.mode = ((size.w, size.h), None);
|
||||
}
|
||||
Err(anyhow::anyhow!("Cannot set window size"))
|
||||
} else {
|
||||
|
|
@ -143,7 +143,7 @@ pub fn init_backend(
|
|||
model: name.clone(),
|
||||
};
|
||||
let mode = Mode {
|
||||
size: (size.w as i32, size.h as i32).into(),
|
||||
size: (size.w, size.h).into(),
|
||||
refresh: 60_000,
|
||||
};
|
||||
let output = Output::new(name, props);
|
||||
|
|
@ -157,7 +157,7 @@ pub fn init_backend(
|
|||
);
|
||||
output.user_data().insert_if_missing(|| {
|
||||
RefCell::new(OutputConfig {
|
||||
mode: ((size.w as i32, size.h as i32), None),
|
||||
mode: ((size.w, size.h), None),
|
||||
transform: Transform::Flipped180.into(),
|
||||
..Default::default()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1881,7 +1881,7 @@ impl State {
|
|||
let res = shell.move_current_window(
|
||||
seat,
|
||||
¤t_output,
|
||||
(¤t_output, Some(workspace as usize)),
|
||||
(¤t_output, Some(workspace)),
|
||||
matches!(x, Action::MoveToLastWorkspace),
|
||||
None,
|
||||
&mut self.common.workspace_state.update(),
|
||||
|
|
@ -1904,7 +1904,7 @@ impl State {
|
|||
shell.move_current_window(
|
||||
seat,
|
||||
¤t_output,
|
||||
(¤t_output, Some(workspace as usize)),
|
||||
(¤t_output, Some(workspace)),
|
||||
matches!(x, Action::MoveToNextWorkspace),
|
||||
direction,
|
||||
&mut self.common.workspace_state.update(),
|
||||
|
|
@ -1949,7 +1949,7 @@ impl State {
|
|||
shell.move_current_window(
|
||||
seat,
|
||||
¤t_output,
|
||||
(¤t_output, Some(workspace as usize)),
|
||||
(¤t_output, Some(workspace)),
|
||||
matches!(x, Action::MoveToPreviousWorkspace),
|
||||
direction,
|
||||
&mut self.common.workspace_state.update(),
|
||||
|
|
|
|||
|
|
@ -2628,7 +2628,7 @@ impl Shell {
|
|||
seat,
|
||||
initial_window_location,
|
||||
cursor_output,
|
||||
active_hint as u8,
|
||||
active_hint,
|
||||
layer,
|
||||
release,
|
||||
evlh.clone(),
|
||||
|
|
|
|||
|
|
@ -80,10 +80,10 @@ where
|
|||
if matches!(buffer_type(&buffer), Some(BufferType::Shm)) {
|
||||
let buffer_size = buffer_dimensions(&buffer).unwrap();
|
||||
if let Err(err) = with_buffer_contents_mut(&buffer, |ptr, len, data| {
|
||||
let offset = data.offset as i32;
|
||||
let width = data.width as i32;
|
||||
let height = data.height as i32;
|
||||
let stride = data.stride as i32;
|
||||
let offset = data.offset;
|
||||
let width = data.width;
|
||||
let height = data.height;
|
||||
let stride = data.stride;
|
||||
let format = shm_format_to_fourcc(data.format)
|
||||
.expect("We should be able to convert all hardcoded shm screencopy formats");
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ impl ToplevelManagementHandler for State {
|
|||
|
||||
let res = shell.activate(
|
||||
&output,
|
||||
idx as usize,
|
||||
idx,
|
||||
WorkspaceDelta::new_shortcut(),
|
||||
&mut self.common.workspace_state.update(),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ impl Common {
|
|||
.outputs()
|
||||
.map(|o| o.current_scale().integer_scale())
|
||||
.max()
|
||||
.unwrap_or(1) as i32
|
||||
.unwrap_or(1)
|
||||
} else {
|
||||
1
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue