broadcast workspace event on focus-follows-mouse cross-monitor
- SHA
a1364c70e71135e62e2fbcac5f7640ebbbc37840- Parents
-
7c141d5 - Tree
9551a69
a1364c7
a1364c70e71135e62e2fbcac5f7640ebbbc378407c141d5
9551a69| Status | File | + | - |
|---|---|---|---|
| M |
gar/src/x11/events.rs
|
8 | 0 |
gar/src/x11/events.rsmodified@@ -1708,10 +1708,18 @@ impl WindowManager { | ||
| 1708 | 1708 | |
| 1709 | 1709 | tracing::debug!("Focus follows mouse: focusing window {}", window); |
| 1710 | 1710 | |
| 1711 | + let old_workspace_idx = self.focused_workspace; | |
| 1712 | + | |
| 1711 | 1713 | // Focus the new window (no warp - mouse enter) |
| 1712 | 1714 | // set_focus handles grab/ungrab for old and new windows |
| 1713 | 1715 | self.set_focus(window, false)?; |
| 1714 | 1716 | |
| 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 | + | |
| 1715 | 1723 | // Raise floating windows on focus |
| 1716 | 1724 | if self.is_floating(window) { |
| 1717 | 1725 | self.raise_window(window)?; |