chore: clippy
This commit is contained in:
parent
c13e52da04
commit
2ca99c670a
59 changed files with 1974 additions and 2137 deletions
271
src/state.rs
271
src/state.rs
|
|
@ -655,9 +655,9 @@ impl State {
|
|||
let cosmic_image_capture_source_state =
|
||||
CosmicImageCaptureSourceState::new::<Self, _>(dh, client_not_sandboxed);
|
||||
let output_capture_source_state =
|
||||
OutputCaptureSourceState::new_with_filter::<State, _>(&dh, client_not_sandboxed);
|
||||
OutputCaptureSourceState::new_with_filter::<State, _>(dh, client_not_sandboxed);
|
||||
let toplevel_capture_source_state =
|
||||
ToplevelCaptureSourceState::new_with_filter::<State, _>(&dh, client_not_sandboxed);
|
||||
ToplevelCaptureSourceState::new_with_filter::<State, _>(dh, client_not_sandboxed);
|
||||
let image_copy_capture_state =
|
||||
ImageCopyCaptureState::new_with_filter::<Self, _>(dh, client_not_sandboxed);
|
||||
let shm_state =
|
||||
|
|
@ -681,7 +681,7 @@ impl State {
|
|||
VirtualKeyboardManagerState::new::<State, _>(dh, client_not_sandboxed);
|
||||
AlphaModifierState::new::<Self>(dh);
|
||||
SinglePixelBufferState::new::<Self>(dh);
|
||||
FixesState::new::<Self>(&dh);
|
||||
FixesState::new::<Self>(dh);
|
||||
|
||||
let idle_notifier_state = IdleNotifierState::<Self>::new(dh, handle.clone());
|
||||
let idle_inhibit_manager_state = IdleInhibitManagerState::new::<State>(dh);
|
||||
|
|
@ -954,10 +954,10 @@ impl Common {
|
|||
};
|
||||
|
||||
// lock surface
|
||||
if let Some(session_lock) = shell.session_lock.as_ref() {
|
||||
if let Some(lock_surface) = session_lock.surfaces.get(output) {
|
||||
with_surfaces_surface_tree(lock_surface.wl_surface(), processor)
|
||||
}
|
||||
if let Some(session_lock) = shell.session_lock.as_ref()
|
||||
&& let Some(lock_surface) = session_lock.surfaces.get(output)
|
||||
{
|
||||
with_surfaces_surface_tree(lock_surface.wl_surface(), processor)
|
||||
}
|
||||
|
||||
for seat in shell
|
||||
|
|
@ -973,11 +973,11 @@ impl Common {
|
|||
}
|
||||
|
||||
// grabs
|
||||
if let Some(move_grab) = seat.user_data().get::<SeatMoveGrabState>() {
|
||||
if let Some(grab_state) = move_grab.lock().unwrap().as_ref() {
|
||||
for (window, _) in grab_state.element().windows() {
|
||||
window.with_surfaces(processor);
|
||||
}
|
||||
if let Some(move_grab) = seat.user_data().get::<SeatMoveGrabState>()
|
||||
&& let Some(grab_state) = move_grab.lock().unwrap().as_ref()
|
||||
{
|
||||
for (window, _) in grab_state.element().windows() {
|
||||
window.with_surfaces(processor);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1037,30 +1037,28 @@ impl Common {
|
|||
) {
|
||||
let shell = self.shell.read();
|
||||
|
||||
if let Some(session_lock) = shell.session_lock.as_ref() {
|
||||
if let Some(lock_surface) = session_lock.surfaces.get(output) {
|
||||
if let Some(feedback) =
|
||||
advertised_node_for_surface(lock_surface.wl_surface(), &self.display_handle)
|
||||
.and_then(&mut dmabuf_feedback)
|
||||
{
|
||||
send_dmabuf_feedback_surface_tree(
|
||||
lock_surface.wl_surface(),
|
||||
output,
|
||||
surface_primary_scanout_output,
|
||||
|surface, _| {
|
||||
select_dmabuf_feedback(
|
||||
surface,
|
||||
render_element_states,
|
||||
&feedback.render_feedback,
|
||||
feedback
|
||||
.primary_scanout_feedback
|
||||
.as_ref()
|
||||
.unwrap_or(&feedback.render_feedback),
|
||||
)
|
||||
},
|
||||
if let Some(session_lock) = shell.session_lock.as_ref()
|
||||
&& let Some(lock_surface) = session_lock.surfaces.get(output)
|
||||
&& let Some(feedback) =
|
||||
advertised_node_for_surface(lock_surface.wl_surface(), &self.display_handle)
|
||||
.and_then(&mut dmabuf_feedback)
|
||||
{
|
||||
send_dmabuf_feedback_surface_tree(
|
||||
lock_surface.wl_surface(),
|
||||
output,
|
||||
surface_primary_scanout_output,
|
||||
|surface, _| {
|
||||
select_dmabuf_feedback(
|
||||
surface,
|
||||
render_element_states,
|
||||
&feedback.render_feedback,
|
||||
feedback
|
||||
.primary_scanout_feedback
|
||||
.as_ref()
|
||||
.unwrap_or(&feedback.render_feedback),
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
for seat in shell
|
||||
|
|
@ -1070,71 +1068,69 @@ impl Common {
|
|||
{
|
||||
let cursor_status = seat.cursor_image_status();
|
||||
|
||||
if let CursorImageStatus::Surface(wl_surface) = cursor_status {
|
||||
if let Some(feedback) =
|
||||
if let CursorImageStatus::Surface(wl_surface) = cursor_status
|
||||
&& let Some(feedback) =
|
||||
advertised_node_for_surface(&wl_surface, &self.display_handle)
|
||||
.and_then(&mut dmabuf_feedback)
|
||||
{
|
||||
send_dmabuf_feedback_surface_tree(
|
||||
&wl_surface,
|
||||
output,
|
||||
surface_primary_scanout_output,
|
||||
|surface, _| {
|
||||
select_dmabuf_feedback(
|
||||
surface,
|
||||
render_element_states,
|
||||
&feedback.render_feedback,
|
||||
feedback
|
||||
.overlay_scanout_feedback
|
||||
.as_ref()
|
||||
.unwrap_or(&feedback.render_feedback),
|
||||
)
|
||||
},
|
||||
);
|
||||
}
|
||||
{
|
||||
send_dmabuf_feedback_surface_tree(
|
||||
&wl_surface,
|
||||
output,
|
||||
surface_primary_scanout_output,
|
||||
|surface, _| {
|
||||
select_dmabuf_feedback(
|
||||
surface,
|
||||
render_element_states,
|
||||
&feedback.render_feedback,
|
||||
feedback
|
||||
.overlay_scanout_feedback
|
||||
.as_ref()
|
||||
.unwrap_or(&feedback.render_feedback),
|
||||
)
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
if let Some(icon) = get_dnd_icon(seat) {
|
||||
if let Some(feedback) =
|
||||
if let Some(icon) = get_dnd_icon(seat)
|
||||
&& let Some(feedback) =
|
||||
advertised_node_for_surface(&icon.surface, &self.display_handle)
|
||||
.and_then(&mut dmabuf_feedback)
|
||||
{
|
||||
send_dmabuf_feedback_surface_tree(
|
||||
&icon.surface,
|
||||
output,
|
||||
surface_primary_scanout_output,
|
||||
|surface, _| {
|
||||
select_dmabuf_feedback(
|
||||
surface,
|
||||
render_element_states,
|
||||
&feedback.render_feedback,
|
||||
feedback
|
||||
.overlay_scanout_feedback
|
||||
.as_ref()
|
||||
.unwrap_or(&feedback.render_feedback),
|
||||
)
|
||||
},
|
||||
);
|
||||
}
|
||||
{
|
||||
send_dmabuf_feedback_surface_tree(
|
||||
&icon.surface,
|
||||
output,
|
||||
surface_primary_scanout_output,
|
||||
|surface, _| {
|
||||
select_dmabuf_feedback(
|
||||
surface,
|
||||
render_element_states,
|
||||
&feedback.render_feedback,
|
||||
feedback
|
||||
.overlay_scanout_feedback
|
||||
.as_ref()
|
||||
.unwrap_or(&feedback.render_feedback),
|
||||
)
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
if let Some(move_grab) = seat.user_data().get::<SeatMoveGrabState>() {
|
||||
if let Some(grab_state) = move_grab.lock().unwrap().as_ref() {
|
||||
for (window, _) in grab_state.element().windows() {
|
||||
if let Some(feedback) = window
|
||||
.wl_surface()
|
||||
.and_then(|wl_surface| {
|
||||
advertised_node_for_surface(&wl_surface, &self.display_handle)
|
||||
})
|
||||
.and_then(&mut dmabuf_feedback)
|
||||
{
|
||||
window.send_dmabuf_feedback(
|
||||
output,
|
||||
&feedback,
|
||||
render_element_states,
|
||||
surface_primary_scanout_output,
|
||||
);
|
||||
}
|
||||
if let Some(move_grab) = seat.user_data().get::<SeatMoveGrabState>()
|
||||
&& let Some(grab_state) = move_grab.lock().unwrap().as_ref()
|
||||
{
|
||||
for (window, _) in grab_state.element().windows() {
|
||||
if let Some(feedback) = window
|
||||
.wl_surface()
|
||||
.and_then(|wl_surface| {
|
||||
advertised_node_for_surface(&wl_surface, &self.display_handle)
|
||||
})
|
||||
.and_then(&mut dmabuf_feedback)
|
||||
{
|
||||
window.send_dmabuf_feedback(
|
||||
output,
|
||||
&feedback,
|
||||
render_element_states,
|
||||
surface_primary_scanout_output,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1167,21 +1163,20 @@ impl Common {
|
|||
});
|
||||
|
||||
if let Some(active) = shell.active_space(output) {
|
||||
if let Some(window) = active.get_fullscreen() {
|
||||
if let Some(feedback) = window
|
||||
if let Some(window) = active.get_fullscreen()
|
||||
&& let Some(feedback) = window
|
||||
.wl_surface()
|
||||
.and_then(|wl_surface| {
|
||||
advertised_node_for_surface(&wl_surface, &self.display_handle)
|
||||
})
|
||||
.and_then(&mut dmabuf_feedback)
|
||||
{
|
||||
window.send_dmabuf_feedback(
|
||||
output,
|
||||
&feedback,
|
||||
render_element_states,
|
||||
surface_primary_scanout_output,
|
||||
);
|
||||
}
|
||||
{
|
||||
window.send_dmabuf_feedback(
|
||||
output,
|
||||
&feedback,
|
||||
render_element_states,
|
||||
surface_primary_scanout_output,
|
||||
);
|
||||
}
|
||||
active.mapped().for_each(|mapped| {
|
||||
for (window, _) in mapped.windows() {
|
||||
|
|
@ -1204,28 +1199,27 @@ impl Common {
|
|||
}
|
||||
|
||||
shell.override_redirect_windows.iter().for_each(|or| {
|
||||
if let Some(wl_surface) = or.wl_surface() {
|
||||
if let Some(feedback) =
|
||||
if let Some(wl_surface) = or.wl_surface()
|
||||
&& let Some(feedback) =
|
||||
advertised_node_for_surface(&wl_surface, &self.display_handle)
|
||||
.and_then(&mut dmabuf_feedback)
|
||||
{
|
||||
send_dmabuf_feedback_surface_tree(
|
||||
&wl_surface,
|
||||
output,
|
||||
surface_primary_scanout_output,
|
||||
|surface, _| {
|
||||
select_dmabuf_feedback(
|
||||
surface,
|
||||
render_element_states,
|
||||
&feedback.render_feedback,
|
||||
feedback
|
||||
.overlay_scanout_feedback
|
||||
.as_ref()
|
||||
.unwrap_or(&feedback.render_feedback),
|
||||
)
|
||||
},
|
||||
)
|
||||
}
|
||||
{
|
||||
send_dmabuf_feedback_surface_tree(
|
||||
&wl_surface,
|
||||
output,
|
||||
surface_primary_scanout_output,
|
||||
|surface, _| {
|
||||
select_dmabuf_feedback(
|
||||
surface,
|
||||
render_element_states,
|
||||
&feedback.render_feedback,
|
||||
feedback
|
||||
.overlay_scanout_feedback
|
||||
.as_ref()
|
||||
.unwrap_or(&feedback.render_feedback),
|
||||
)
|
||||
},
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -1280,10 +1274,11 @@ impl Common {
|
|||
|
||||
// If we already sent a frame callback to this surface this output refresh
|
||||
// cycle, don't send one again to prevent empty-damage commit busy loops.
|
||||
if let Some((last_output, last_sequence)) = &*last_sent_at {
|
||||
if last_output == output && *last_sequence == sequence {
|
||||
send = false;
|
||||
}
|
||||
if let Some((last_output, last_sequence)) = &*last_sent_at
|
||||
&& last_output == output
|
||||
&& *last_sequence == sequence
|
||||
{
|
||||
send = false;
|
||||
}
|
||||
|
||||
if send {
|
||||
|
|
@ -1306,16 +1301,10 @@ impl Common {
|
|||
|
||||
let shell = self.shell.read();
|
||||
|
||||
if let Some(session_lock) = shell.session_lock.as_ref() {
|
||||
if let Some(lock_surface) = session_lock.surfaces.get(output) {
|
||||
send_frames_surface_tree(
|
||||
lock_surface.wl_surface(),
|
||||
output,
|
||||
time,
|
||||
None,
|
||||
should_send,
|
||||
);
|
||||
}
|
||||
if let Some(session_lock) = shell.session_lock.as_ref()
|
||||
&& let Some(lock_surface) = session_lock.surfaces.get(output)
|
||||
{
|
||||
send_frames_surface_tree(lock_surface.wl_surface(), output, time, None, should_send);
|
||||
}
|
||||
|
||||
for seat in shell
|
||||
|
|
@ -1335,11 +1324,11 @@ impl Common {
|
|||
)
|
||||
}
|
||||
|
||||
if let Some(move_grab) = seat.user_data().get::<SeatMoveGrabState>() {
|
||||
if let Some(grab_state) = move_grab.lock().unwrap().as_ref() {
|
||||
for (window, _) in grab_state.element().windows() {
|
||||
window.send_frame(output, time, throttle(&window), should_send);
|
||||
}
|
||||
if let Some(move_grab) = seat.user_data().get::<SeatMoveGrabState>()
|
||||
&& let Some(grab_state) = move_grab.lock().unwrap().as_ref()
|
||||
{
|
||||
for (window, _) in grab_state.element().windows() {
|
||||
window.send_frame(output, time, throttle(&window), should_send);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue