diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-10-31 07:16:36 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-10-31 07:16:36 +0400 |
| commit | d854c2d699b15c68c4715dc6be803065c01f2fe6 (patch) | |
| tree | 0fd179b12c415503c5dcd2851a43a32b7ac54321 /src/handlers | |
| parent | 25e701d9ce7dccc45e94ed1e2573f629df2bdefb (diff) | |
| download | niri-d854c2d699b15c68c4715dc6be803065c01f2fe6.tar.gz niri-d854c2d699b15c68c4715dc6be803065c01f2fe6.tar.bz2 niri-d854c2d699b15c68c4715dc6be803065c01f2fe6.zip | |
Change cursor to crosshairs when taking a screenshot
Diffstat (limited to 'src/handlers')
| -rw-r--r-- | src/handlers/mod.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index b23d1abb..049798dc 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -11,7 +11,7 @@ use std::thread; use smithay::backend::allocator::dmabuf::Dmabuf; use smithay::backend::renderer::ImportDma; use smithay::desktop::{PopupKind, PopupManager}; -use smithay::input::pointer::CursorImageStatus; +use smithay::input::pointer::{CursorIcon, CursorImageStatus}; use smithay::input::{Seat, SeatHandler, SeatState}; use smithay::output::Output; use smithay::reexports::wayland_server::protocol::wl_data_source::WlDataSource; @@ -52,7 +52,12 @@ impl SeatHandler for State { &mut self.niri.seat_state } - fn cursor_image(&mut self, _seat: &Seat<Self>, image: CursorImageStatus) { + fn cursor_image(&mut self, _seat: &Seat<Self>, mut image: CursorImageStatus) { + // FIXME: this hack should be removable once the screenshot UI is tracked with a + // PointerFocus properly. + if self.niri.screenshot_ui.is_open() { + image = CursorImageStatus::Named(CursorIcon::Crosshair); + } self.niri.cursor_manager.set_cursor_image(image); // FIXME: more granular self.niri.queue_redraw_all(); |
