gardesk/garshot / 827a0ab

Browse files

annotate: fix initial toolbar visibility and handle expose events

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
827a0ab0894545ff88ec1997804cd9ee2051e16d
Parents
320efcd
Tree
1e433f7

1 changed file

StatusFile+-
M garshot/src/annotate/overlay.rs 14 1
garshot/src/annotate/overlay.rsmodified
@@ -195,8 +195,13 @@ impl AnnotationOverlay {
195195
         // Map window (gar will manage it as a floating dialog)
196196
         self.window.map()?;
197197
 
198
-        // Focus window for keyboard input (no grab - allows WM keybinds to work)
198
+        // Flush and sync to ensure window is mapped before we try to draw
199
+        self.conn.inner().flush()?;
200
+        self.conn.inner().sync()?;
201
+
202
+        // Focus and raise window for keyboard input (no grab - allows WM keybinds to work)
199203
         self.window.focus()?;
204
+        self.window.raise()?;
200205
 
201206
         // Set initial cursor
202207
         self.update_cursor()?;
@@ -204,6 +209,9 @@ impl AnnotationOverlay {
204209
         // Initial draw
205210
         self.redraw()?;
206211
 
212
+        // Flush to ensure initial draw is visible
213
+        self.conn.inner().flush()?;
214
+
207215
         // Event loop
208216
         loop {
209217
             // Wait for first event
@@ -501,6 +509,11 @@ impl AnnotationOverlay {
501509
                 }
502510
             }
503511
 
512
+            // Handle expose events (window needs redraw)
513
+            InputEvent::Expose => {
514
+                return Ok(true);
515
+            }
516
+
504517
             _ => {}
505518
         }
506519