Redraw on cursor or DnD surface commits
Browse files at this commit180d07aab9b96a6b6794561a42ce1a7ad246d989Parent: f9293701 changed file +13 -0
- src/handlers/compositor.rs +13 -0
src/handlers/compositor.rsmodified+13 -0
| @@ -2,6 +2,7 @@ use std::collections::hash_map::Entry; | |||
| 2 | 2 | ||
| 3 | use smithay::backend::renderer::utils::{on_commit_buffer_handler, with_renderer_surface_state}; | 3 | use smithay::backend::renderer::utils::{on_commit_buffer_handler, with_renderer_surface_state}; |
| 4 | use smithay::desktop::find_popup_root_surface; | 4 | use smithay::desktop::find_popup_root_surface; |
| 5 | +use smithay::input::pointer::CursorImageStatus; | ||
| 5 | use smithay::reexports::calloop::Interest; | 6 | use smithay::reexports::calloop::Interest; |
| 6 | use smithay::reexports::wayland_server::protocol::wl_buffer; | 7 | use smithay::reexports::wayland_server::protocol::wl_buffer; |
| 7 | use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface; | 8 | use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface; |
| @@ -148,6 +149,18 @@ impl CompositorHandler for State { | |||
| 148 | 149 | ||
| 149 | // This might be a layer-shell surface. | 150 | // This might be a layer-shell surface. |
| 150 | self.layer_shell_handle_commit(surface); | 151 | self.layer_shell_handle_commit(surface); |
| 152 | + | ||
| 153 | + // This might be a cursor surface. | ||
| 154 | + if matches!(&self.niri.cursor_image, CursorImageStatus::Surface(s) if s == surface) { | ||
| 155 | + // FIXME: granular redraws for cursors. | ||
| 156 | + self.niri.queue_redraw_all(); | ||
| 157 | + } | ||
| 158 | + | ||
| 159 | + // This might be a DnD icon surface. | ||
| 160 | + if self.niri.dnd_icon.as_ref() == Some(surface) { | ||
| 161 | + // FIXME: granular redraws for cursors. | ||
| 162 | + self.niri.queue_redraw_all(); | ||
| 163 | + } | ||
| 151 | } | 164 | } |
| 152 | } | 165 | } |
| 153 | 166 | ||