@@ -1212,13 +1212,30 @@ impl WindowManager { |
| 1212 | 1212 | // Check for tiled edge hover (for cursor feedback) |
| 1213 | 1213 | self.update_tiled_edge_cursor(window, event.root_x, event.root_y)?; |
| 1214 | 1214 | } |
| 1215 | | - } else if self.tiled_edge_cursor.is_some() { |
| 1216 | | - // Moving to unmanaged window or root - clear tiled edge cursor |
| 1217 | | - let (old_w1, old_w2, _) = self.tiled_edge_cursor.unwrap(); |
| 1218 | | - self.conn.clear_window_cursor(old_w1)?; |
| 1219 | | - self.conn.clear_window_cursor(old_w2)?; |
| 1220 | | - self.conn.flush()?; |
| 1221 | | - self.tiled_edge_cursor = None; |
| 1215 | + } else { |
| 1216 | + if self.tiled_edge_cursor.is_some() { |
| 1217 | + // Moving to unmanaged window or root - clear tiled edge cursor |
| 1218 | + let (old_w1, old_w2, _) = self.tiled_edge_cursor.unwrap(); |
| 1219 | + self.conn.clear_window_cursor(old_w1)?; |
| 1220 | + self.conn.clear_window_cursor(old_w2)?; |
| 1221 | + self.conn.flush()?; |
| 1222 | + self.tiled_edge_cursor = None; |
| 1223 | + } |
| 1224 | + // Pointer is on root/empty desktop — check for cross-monitor movement |
| 1225 | + let monitor_idx = self.monitor_idx_at_point(event.root_x, event.root_y); |
| 1226 | + if monitor_idx != self.focused_monitor { |
| 1227 | + let old_workspace_idx = self.focused_workspace; |
| 1228 | + self.focused_monitor = monitor_idx; |
| 1229 | + let workspace_idx = self.monitors[monitor_idx].active_workspace; |
| 1230 | + self.focused_workspace = workspace_idx; |
| 1231 | + self.focused_window = None; |
| 1232 | + self.conn.set_active_window(None)?; |
| 1233 | + self.conn.set_current_desktop(workspace_idx as u32)?; |
| 1234 | + if workspace_idx != old_workspace_idx { |
| 1235 | + self.broadcast_i3_workspace_event("focus", workspace_idx, Some(old_workspace_idx)); |
| 1236 | + } |
| 1237 | + self.conn.flush()?; |
| 1238 | + } |
| 1222 | 1239 | } |
| 1223 | 1240 | return Ok(()); |
| 1224 | 1241 | } |