chore: clippy fixes
This commit is contained in:
parent
9feaa865ab
commit
8ab946f10a
4 changed files with 17 additions and 25 deletions
|
|
@ -36,7 +36,7 @@ impl Common {
|
||||||
) -> Result<Socket> {
|
) -> Result<Socket> {
|
||||||
let socket_name = format!(
|
let socket_name = format!(
|
||||||
"{}-{}",
|
"{}-{}",
|
||||||
&self.socket.to_string_lossy(),
|
self.socket.to_string_lossy(),
|
||||||
render_node
|
render_node
|
||||||
.dev_path()
|
.dev_path()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|
|
||||||
|
|
@ -3878,13 +3878,13 @@ impl Shell {
|
||||||
}
|
}
|
||||||
|
|
||||||
(initial_window_location, layer, workspace.handle)
|
(initial_window_location, layer, workspace.handle)
|
||||||
} else if let Some(sticky_layer) = self
|
} else {
|
||||||
|
let sticky_layer = self
|
||||||
.workspaces
|
.workspaces
|
||||||
.sets
|
.sets
|
||||||
.get_mut(&cursor_output)
|
.get_mut(&cursor_output)
|
||||||
.filter(|set| set.sticky_layer.mapped().any(|m| m == &old_mapped))
|
.filter(|set| set.sticky_layer.mapped().any(|m| m == &old_mapped))
|
||||||
.map(|set| &mut set.sticky_layer)
|
.map(|set| &mut set.sticky_layer)?;
|
||||||
{
|
|
||||||
let elem_geo = sticky_layer.element_geometry(&old_mapped).unwrap();
|
let elem_geo = sticky_layer.element_geometry(&old_mapped).unwrap();
|
||||||
let mut initial_window_location = elem_geo.loc.to_global(&cursor_output);
|
let mut initial_window_location = elem_geo.loc.to_global(&cursor_output);
|
||||||
|
|
||||||
|
|
@ -3927,8 +3927,6 @@ impl Shell {
|
||||||
ManagedLayer::Sticky,
|
ManagedLayer::Sticky,
|
||||||
self.active_space(&cursor_output).unwrap().handle,
|
self.active_space(&cursor_output).unwrap().handle,
|
||||||
)
|
)
|
||||||
} else {
|
|
||||||
return None;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
toplevel_leave_workspace(&window, &workspace_handle);
|
toplevel_leave_workspace(&window, &workspace_handle);
|
||||||
|
|
@ -4222,14 +4220,13 @@ impl Shell {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.to_global(&set.output);
|
.to_global(&set.output);
|
||||||
(&mut set.sticky_layer, geometry)
|
(&mut set.sticky_layer, geometry)
|
||||||
} else if let Some(workspace) = self.space_for_mut(mapped) {
|
} else {
|
||||||
|
let workspace = self.space_for_mut(mapped)?;
|
||||||
let geometry = workspace
|
let geometry = workspace
|
||||||
.element_geometry(mapped)
|
.element_geometry(mapped)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.to_global(workspace.output());
|
.to_global(workspace.output());
|
||||||
(&mut workspace.floating_layer, geometry)
|
(&mut workspace.floating_layer, geometry)
|
||||||
} else {
|
|
||||||
return None;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let new_loc = if edge.contains(ResizeEdge::LEFT) {
|
let new_loc = if edge.contains(ResizeEdge::LEFT) {
|
||||||
|
|
@ -4266,7 +4263,8 @@ impl Shell {
|
||||||
ReleaseMode::Click,
|
ReleaseMode::Click,
|
||||||
) {
|
) {
|
||||||
grab.into()
|
grab.into()
|
||||||
} else if let Some(ws) = self.space_for_mut(mapped) {
|
} else {
|
||||||
|
let ws = self.space_for_mut(mapped)?;
|
||||||
let node_id = mapped.tiling_node_id.lock().unwrap().clone()?;
|
let node_id = mapped.tiling_node_id.lock().unwrap().clone()?;
|
||||||
let (node, left_up_idx, orientation) = ws.tiling_layer.resize_request(node_id, edge)?;
|
let (node, left_up_idx, orientation) = ws.tiling_layer.resize_request(node_id, edge)?;
|
||||||
ResizeForkGrab::new(
|
ResizeForkGrab::new(
|
||||||
|
|
@ -4279,8 +4277,6 @@ impl Shell {
|
||||||
ReleaseMode::Click,
|
ReleaseMode::Click,
|
||||||
)
|
)
|
||||||
.into()
|
.into()
|
||||||
} else {
|
|
||||||
return None;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Some(((focus, new_loc), (grab, Focus::Keep)))
|
Some(((focus, new_loc), (grab, Focus::Keep)))
|
||||||
|
|
@ -4517,10 +4513,9 @@ impl Shell {
|
||||||
.find(|set| set.sticky_layer.mapped().any(|m| m == &mapped))
|
.find(|set| set.sticky_layer.mapped().any(|m| m == &mapped))
|
||||||
{
|
{
|
||||||
&mut set.sticky_layer
|
&mut set.sticky_layer
|
||||||
} else if let Some(workspace) = self.space_for_mut(&mapped) {
|
|
||||||
&mut workspace.floating_layer
|
|
||||||
} else {
|
} else {
|
||||||
return None;
|
let workspace = self.space_for_mut(&mapped)?;
|
||||||
|
&mut workspace.floating_layer
|
||||||
};
|
};
|
||||||
|
|
||||||
let grab: ResizeGrab = if let Some(grab) = floating_layer.resize_request(
|
let grab: ResizeGrab = if let Some(grab) = floating_layer.resize_request(
|
||||||
|
|
@ -4532,7 +4527,8 @@ impl Shell {
|
||||||
ReleaseMode::NoMouseButtons,
|
ReleaseMode::NoMouseButtons,
|
||||||
) {
|
) {
|
||||||
grab.into()
|
grab.into()
|
||||||
} else if let Some(ws) = self.space_for_mut(&mapped) {
|
} else {
|
||||||
|
let ws = self.space_for_mut(&mapped)?;
|
||||||
let node_id = mapped.tiling_node_id.lock().unwrap().clone()?;
|
let node_id = mapped.tiling_node_id.lock().unwrap().clone()?;
|
||||||
let (node, left_up_idx, orientation) =
|
let (node, left_up_idx, orientation) =
|
||||||
ws.tiling_layer.resize_request(node_id, edges)?;
|
ws.tiling_layer.resize_request(node_id, edges)?;
|
||||||
|
|
@ -4546,8 +4542,6 @@ impl Shell {
|
||||||
ReleaseMode::NoMouseButtons,
|
ReleaseMode::NoMouseButtons,
|
||||||
)
|
)
|
||||||
.into()
|
.into()
|
||||||
} else {
|
|
||||||
return None;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Some((grab, Focus::Clear))
|
Some((grab, Focus::Clear))
|
||||||
|
|
@ -4904,7 +4898,8 @@ impl Shell {
|
||||||
})),
|
})),
|
||||||
Some(from),
|
Some(from),
|
||||||
);
|
);
|
||||||
} else if let Some(workspace) = self.space_for_mut(&mapped) {
|
} else {
|
||||||
|
let workspace = self.space_for_mut(&mapped)?;
|
||||||
if mapped.is_minimized() {
|
if mapped.is_minimized() {
|
||||||
// TODO: Rewrite the `MinimizedWindow` to restore to fullscreen
|
// TODO: Rewrite the `MinimizedWindow` to restore to fullscreen
|
||||||
return None;
|
return None;
|
||||||
|
|
@ -4952,8 +4947,6 @@ impl Shell {
|
||||||
},
|
},
|
||||||
Some(from),
|
Some(from),
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
return None;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Some(KeyboardFocusTarget::Fullscreen(window))
|
Some(KeyboardFocusTarget::Fullscreen(window))
|
||||||
|
|
|
||||||
|
|
@ -688,7 +688,7 @@ impl State {
|
||||||
AlphaModifierState::new::<Self>(dh);
|
AlphaModifierState::new::<Self>(dh);
|
||||||
SinglePixelBufferState::new::<Self>(dh);
|
SinglePixelBufferState::new::<Self>(dh);
|
||||||
FixesState::new::<Self>(dh);
|
FixesState::new::<Self>(dh);
|
||||||
let keyboard_layout_state = KeyboardLayoutState::new::<State, _>(&dh, client_not_sandboxed);
|
let keyboard_layout_state = KeyboardLayoutState::new::<State, _>(dh, client_not_sandboxed);
|
||||||
|
|
||||||
let background_effect_state = BackgroundEffectState::new::<Self>(dh);
|
let background_effect_state = BackgroundEffectState::new::<Self>(dh);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,8 @@ impl KeyboardLayoutState {
|
||||||
{
|
{
|
||||||
let mut keyboard_layouts = mem::take(&mut state.keyboard_layout_state().keyboard_layouts);
|
let mut keyboard_layouts = mem::take(&mut state.keyboard_layout_state().keyboard_layouts);
|
||||||
for (keyboard_layout, last_layout) in &mut keyboard_layouts {
|
for (keyboard_layout, last_layout) in &mut keyboard_layouts {
|
||||||
if let Some(data) = keyboard_layout.data::<LayoutUserData<D>>() {
|
if let Some(data) = keyboard_layout.data::<LayoutUserData<D>>()
|
||||||
if let Some(handle) = &data.handle {
|
&& let Some(handle) = &data.handle {
|
||||||
let active_layout = handle.with_xkb_state(state, |context| {
|
let active_layout = handle.with_xkb_state(state, |context| {
|
||||||
context.xkb().lock().unwrap().active_layout()
|
context.xkb().lock().unwrap().active_layout()
|
||||||
});
|
});
|
||||||
|
|
@ -61,7 +61,6 @@ impl KeyboardLayoutState {
|
||||||
*last_layout = Some(active_layout);
|
*last_layout = Some(active_layout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
state.keyboard_layout_state().keyboard_layouts = keyboard_layouts;
|
state.keyboard_layout_state().keyboard_layouts = keyboard_layouts;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue