gardesk/garshot / 320efcd

Browse files

annotate: remove keyboard grab to allow WM keybinds

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
320efcdefb7fa58e27031801bf4d920141234a02
Parents
6f01cd2
Tree
47b1f5a

1 changed file

StatusFile+-
M garshot/src/annotate/overlay.rs 4 11
garshot/src/annotate/overlay.rsmodified
@@ -195,9 +195,8 @@ impl AnnotationOverlay {
195195
         // Map window (gar will manage it as a floating dialog)
196196
         self.window.map()?;
197197
 
198
-        // Grab keyboard for our shortcuts (Escape, Ctrl+Enter, tool keys, etc.)
199
-        // Don't grab pointer - let gar handle mod+drag for window movement
200
-        self.window.grab_keyboard_with_retry(10, 50)?;
198
+        // Focus window for keyboard input (no grab - allows WM keybinds to work)
199
+        self.window.focus()?;
201200
 
202201
         // Set initial cursor
203202
         self.update_cursor()?;
@@ -242,9 +241,6 @@ impl AnnotationOverlay {
242241
             }
243242
         }
244243
 
245
-        // Cleanup
246
-        self.window.ungrab_keyboard()?;
247
-
248244
         // Return result
249245
         Ok(self.state.take_result().unwrap_or(AnnotationResult::Cancel))
250246
     }
@@ -629,14 +625,11 @@ impl AnnotationOverlay {
629625
     fn run_eyedropper(&mut self) -> Result<Option<gartk_core::Color>> {
630626
         use crate::annotate::ui::color_picker::eyedropper::{Eyedropper, EyedropperResult};
631627
 
632
-        // Temporarily release our keyboard grab so eyedropper can grab
633
-        self.window.ungrab_keyboard()?;
634
-
635628
         let eyedropper = Eyedropper::new()?;
636629
         let result = eyedropper.run()?;
637630
 
638
-        // Regrab keyboard for our window
639
-        self.window.grab_keyboard_with_retry(10, 50)?;
631
+        // Restore focus to our window after eyedropper closes
632
+        self.window.focus()?;
640633
 
641634
         match result {
642635
             EyedropperResult::Color(color) => Ok(Some(color)),