gardesk/gar / a1364c7

Browse files

broadcast workspace event on focus-follows-mouse cross-monitor

Authored by espadonne
SHA
a1364c70e71135e62e2fbcac5f7640ebbbc37840
Parents
7c141d5
Tree
9551a69

1 changed file

StatusFile+-
M gar/src/x11/events.rs 8 0
gar/src/x11/events.rsmodified
@@ -1708,10 +1708,18 @@ impl WindowManager {
17081708
 
17091709
         tracing::debug!("Focus follows mouse: focusing window {}", window);
17101710
 
1711
+        let old_workspace_idx = self.focused_workspace;
1712
+
17111713
         // Focus the new window (no warp - mouse enter)
17121714
         // set_focus handles grab/ungrab for old and new windows
17131715
         self.set_focus(window, false)?;
17141716
 
1717
+        // If workspace changed (cross-monitor mouse move), update EWMH and notify garbar
1718
+        if self.focused_workspace != old_workspace_idx {
1719
+            self.conn.set_current_desktop(self.focused_workspace as u32)?;
1720
+            self.broadcast_i3_workspace_event("focus", self.focused_workspace, Some(old_workspace_idx));
1721
+        }
1722
+
17151723
         // Raise floating windows on focus
17161724
         if self.is_floating(window) {
17171725
             self.raise_window(window)?;