chore: clippy

This commit is contained in:
Vukašin Vojinović 2026-02-23 16:25:06 +01:00 • committed by Victoria Brekenfeld
parent c13e52da04
commit 2ca99c670a
59 changed files with 1974 additions and 2137 deletions

View file

@ -73,7 +73,7 @@ fn xdg_popup_ensure_initial_configure(popup: &PopupKind) {
fn layer_surface_check_inital_configure(surface: &LayerSurface) -> bool {
// send the initial configure if relevant
let initial_configure_sent = with_states(surface.wl_surface(), |states| {
with_states(surface.wl_surface(), |states| {
states
.data_map
.get::<Mutex<LayerSurfaceAttributes>>()
@ -81,9 +81,7 @@ fn layer_surface_check_inital_configure(surface: &LayerSurface) -> bool {
.lock()
.unwrap()
.initial_configure_sent
});
initial_configure_sent
})
}
pub fn client_compositor_state(client: &Client) -> &CompositorClientState {
@ -195,23 +193,24 @@ impl CompositorHandler for State {
})
});
if let Some(dmabuf) = maybe_dmabuf {
if let Some(acquire_point) = acquire_point {
if let Ok((blocker, source)) = acquire_point.generate_blocker() {
let client = surface.client().unwrap();
let res = state.common.event_loop_handle.insert_source(
source,
move |_, _, state| {
if let Some(acquire_point) = acquire_point
&& let Ok((blocker, source)) = acquire_point.generate_blocker()
{
let client = surface.client().unwrap();
let res =
state
.common
.event_loop_handle
.insert_source(source, move |_, _, state| {
let dh = state.common.display_handle.clone();
state
.client_compositor_state(&client)
.blocker_cleared(state, &dh);
Ok(())
},
);
if res.is_ok() {
add_blocker(surface, blocker);
return;
}
});
if res.is_ok() {
add_blocker(surface, blocker);
return;
}
}
if let Ok((blocker, source)) = dmabuf.generate_blocker(Interest::READ) {
@ -379,35 +378,34 @@ impl State {
.pending_windows
.iter()
.find(|pending| pending.surface.wl_surface().as_deref() == Some(surface))
&& let Some(toplevel) = pending.surface.0.toplevel()
{
if let Some(toplevel) = pending.surface.0.toplevel() {
let initial_size = if let Some(output) = pending.fullscreen.as_ref() {
Some(output.geometry().size.as_logical())
} else if pending.maximized {
let active_output = shell.seats.last_active().active_output();
let zone = layer_map_for_output(&active_output).non_exclusive_zone();
Some(zone.size)
} else {
None
};
if toplevel_ensure_initial_configure(toplevel, initial_size)
&& with_renderer_surface_state(surface, |state| state.buffer().is_some())
.unwrap_or(false)
{
let window = pending.surface.clone();
window.on_commit();
let res = shell.map_window(
&window,
&mut self.common.toplevel_info_state,
&mut self.common.workspace_state,
&self.common.event_loop_handle,
);
if let Some(target) = res {
let seat = shell.seats.last_active().clone();
std::mem::drop(shell);
Shell::set_focus(self, Some(&target), &seat, None, true);
return true;
}
let initial_size = if let Some(output) = pending.fullscreen.as_ref() {
Some(output.geometry().size.as_logical())
} else if pending.maximized {
let active_output = shell.seats.last_active().active_output();
let zone = layer_map_for_output(&active_output).non_exclusive_zone();
Some(zone.size)
} else {
None
};
if toplevel_ensure_initial_configure(toplevel, initial_size)
&& with_renderer_surface_state(surface, |state| state.buffer().is_some())
.unwrap_or(false)
{
let window = pending.surface.clone();
window.on_commit();
let res = shell.map_window(
&window,
&mut self.common.toplevel_info_state,
&mut self.common.workspace_state,
&self.common.event_loop_handle,
);
if let Some(target) = res {
let seat = shell.seats.last_active().clone();
std::mem::drop(shell);
Shell::set_focus(self, Some(&target), &seat, None, true);
return true;
}
}
}
@ -417,17 +415,16 @@ impl State {
.iter()
.find(|pending| pending.surface.wl_surface() == surface)
.map(|pending| pending.surface.clone())
&& !layer_surface_check_inital_configure(&layer_surface)
{
if !layer_surface_check_inital_configure(&layer_surface) {
// compute initial dimensions by mapping
if let Some(target) = shell.map_layer(&layer_surface) {
let seat = shell.seats.last_active().clone();
std::mem::drop(shell);
Shell::set_focus(self, Some(&target), &seat, None, false);
}
layer_surface.layer_surface().send_configure();
return true;
// compute initial dimensions by mapping
if let Some(target) = shell.map_layer(&layer_surface) {
let seat = shell.seats.last_active().clone();
std::mem::drop(shell);
Shell::set_focus(self, Some(&target), &seat, None, false);
}
layer_surface.layer_surface().send_configure();
return true;
};
false