@@ -718,9 +718,15 @@ impl WindowManager { |
| 718 | 718 | let work_area = self.work_area(); |
| 719 | 719 | let geometries = self.current_workspace().tree.calculate_geometries(work_area); |
| 720 | 720 | |
| 721 | | - if let Some((window, direction, container_size)) = |
| 722 | | - self.find_tiled_edge(event.root_x, event.root_y, &geometries) |
| 723 | | - { |
| 721 | + tracing::debug!( |
| 722 | + "Tiled edge check: pos=({},{}), work_area={:?}, geometries={:?}", |
| 723 | + event.root_x, event.root_y, work_area, geometries |
| 724 | + ); |
| 725 | + |
| 726 | + let edge_result = self.find_tiled_edge(event.root_x, event.root_y, &geometries); |
| 727 | + tracing::debug!("find_tiled_edge result: {:?}", edge_result); |
| 728 | + |
| 729 | + if let Some((window, direction, container_size)) = edge_result { |
| 724 | 730 | // Get current ratio from tree |
| 725 | 731 | let start_ratio = self |
| 726 | 732 | .current_workspace() |
@@ -1105,28 +1111,37 @@ impl WindowManager { |
| 1105 | 1111 | |
| 1106 | 1112 | let edge = self.find_tiled_edge(root_x, root_y, &geometries); |
| 1107 | 1113 | |
| 1108 | | - let new_direction = edge.map(|(_, dir, _)| dir); |
| 1114 | + let new_state = edge.map(|(w, dir, _)| (w, dir)); |
| 1109 | 1115 | |
| 1110 | 1116 | // Check if cursor state changed |
| 1111 | | - if new_direction == self.tiled_edge_cursor { |
| 1117 | + if new_state.map(|(_, d)| d) == self.tiled_edge_cursor { |
| 1112 | 1118 | return Ok(()); // No change |
| 1113 | 1119 | } |
| 1114 | 1120 | |
| 1115 | | - if let Some(dir) = new_direction { |
| 1116 | | - // Set resize cursor on root (double-arrow cursors) |
| 1121 | + // Clear old cursor state |
| 1122 | + if self.tiled_edge_cursor.is_some() { |
| 1123 | + // Clear cursor on all tiled windows and root |
| 1124 | + for (win, _) in &geometries { |
| 1125 | + self.conn.clear_window_cursor(*win)?; |
| 1126 | + } |
| 1127 | + self.conn.clear_window_cursor(self.conn.root)?; |
| 1128 | + } |
| 1129 | + |
| 1130 | + if let Some((_, dir)) = new_state { |
| 1131 | + // Set resize cursor on all tiled windows AND root |
| 1132 | + // This ensures cursor shows even when mouse is over a window |
| 1117 | 1133 | let cursor = match dir { |
| 1118 | 1134 | Direction::Left | Direction::Right => self.conn.cursor_h_double, |
| 1119 | 1135 | Direction::Up | Direction::Down => self.conn.cursor_v_double, |
| 1120 | 1136 | }; |
| 1137 | + for (win, _) in &geometries { |
| 1138 | + self.conn.set_window_cursor(*win, cursor)?; |
| 1139 | + } |
| 1121 | 1140 | self.conn.set_window_cursor(self.conn.root, cursor)?; |
| 1122 | 1141 | self.conn.flush()?; |
| 1123 | | - } else if self.tiled_edge_cursor.is_some() { |
| 1124 | | - // Clear resize cursor from root |
| 1125 | | - self.conn.clear_window_cursor(self.conn.root)?; |
| 1126 | | - self.conn.flush()?; |
| 1127 | 1142 | } |
| 1128 | 1143 | |
| 1129 | | - self.tiled_edge_cursor = new_direction; |
| 1144 | + self.tiled_edge_cursor = new_state.map(|(_, d)| d); |
| 1130 | 1145 | Ok(()) |
| 1131 | 1146 | } |
| 1132 | 1147 | |