@@ -153,7 +153,7 @@ impl WindowManager { |
| 153 | 153 | self.apply_layout()?; |
| 154 | 154 | // Focus the first window |
| 155 | 155 | if let Some(window) = self.focused_window { |
| 156 | | - self.set_focus(window)?; |
| 156 | + self.set_focus(window, true)?; |
| 157 | 157 | self.conn.ungrab_button(window)?; |
| 158 | 158 | } |
| 159 | 159 | tracing::info!("Adopted {} existing windows", adopted); |
@@ -276,7 +276,7 @@ impl WindowManager { |
| 276 | 276 | |
| 277 | 277 | // Focus the new window (only if on current workspace) |
| 278 | 278 | if target_idx == self.focused_workspace { |
| 279 | | - self.set_focus(window)?; |
| 279 | + self.set_focus(window, true)?; |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | Ok(()) |
@@ -317,7 +317,7 @@ impl WindowManager { |
| 317 | 317 | |
| 318 | 318 | // Focus next window or warp to monitor if none left |
| 319 | 319 | if let Some(win) = self.focused_window { |
| 320 | | - self.set_focus(win)?; |
| 320 | + self.set_focus(win, true)?; |
| 321 | 321 | } else { |
| 322 | 322 | // No windows left, warp to current monitor center |
| 323 | 323 | self.warp_to_monitor(self.focused_monitor)?; |
@@ -344,7 +344,7 @@ impl WindowManager { |
| 344 | 344 | |
| 345 | 345 | // Focus next window or warp to monitor if none left |
| 346 | 346 | if let Some(window) = self.focused_window { |
| 347 | | - self.set_focus(window)?; |
| 347 | + self.set_focus(window, true)?; |
| 348 | 348 | } else { |
| 349 | 349 | // No windows left, warp to current monitor center |
| 350 | 350 | self.warp_to_monitor(self.focused_monitor)?; |
@@ -412,8 +412,8 @@ impl WindowManager { |
| 412 | 412 | self.conn.grab_button(old)?; |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | | - // Set focus and ungrab button on new focused window |
| 416 | | - self.set_focus(window)?; |
| 415 | + // Set focus and ungrab button on new focused window (no warp - mouse click) |
| 416 | + self.set_focus(window, false)?; |
| 417 | 417 | self.conn.ungrab_button(window)?; |
| 418 | 418 | |
| 419 | 419 | // Raise floating windows on focus |
@@ -524,8 +524,8 @@ impl WindowManager { |
| 524 | 524 | self.conn.grab_button(old)?; |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | | - // Focus the new window (this will warp pointer back, but we'll suppress the resulting EnterNotify) |
| 528 | | - self.set_focus(window)?; |
| 527 | + // Focus the new window (no warp - mouse enter) |
| 528 | + self.set_focus(window, false)?; |
| 529 | 529 | self.conn.ungrab_button(window)?; |
| 530 | 530 | |
| 531 | 531 | // Raise floating windows on focus |
@@ -554,11 +554,11 @@ impl WindowManager { |
| 554 | 554 | self.switch_workspace(ws_idx)?; |
| 555 | 555 | } |
| 556 | 556 | } |
| 557 | | - // Focus the window |
| 557 | + // Focus the window (external activation, warp pointer) |
| 558 | 558 | if let Some(old) = self.focused_window { |
| 559 | 559 | self.conn.grab_button(old)?; |
| 560 | 560 | } |
| 561 | | - self.set_focus(window)?; |
| 561 | + self.set_focus(window, true)?; |
| 562 | 562 | self.conn.ungrab_button(window)?; |
| 563 | 563 | if self.is_floating(window) { |
| 564 | 564 | self.raise_window(window)?; |
@@ -854,8 +854,8 @@ impl WindowManager { |
| 854 | 854 | // Regrab button on old window |
| 855 | 855 | self.conn.grab_button(focused)?; |
| 856 | 856 | |
| 857 | | - // Focus new window |
| 858 | | - self.set_focus(target)?; |
| 857 | + // Focus new window (keyboard navigation, warp pointer) |
| 858 | + self.set_focus(target, true)?; |
| 859 | 859 | self.conn.ungrab_button(target)?; |
| 860 | 860 | self.conn.flush()?; |
| 861 | 861 | |
@@ -909,7 +909,7 @@ impl WindowManager { |
| 909 | 909 | if let Some(old) = self.focused_window { |
| 910 | 910 | self.conn.grab_button(old)?; |
| 911 | 911 | } |
| 912 | | - self.set_focus(window)?; |
| 912 | + self.set_focus(window, true)?; |
| 913 | 913 | self.conn.ungrab_button(window)?; |
| 914 | 914 | } else { |
| 915 | 915 | // No windows on target monitor - clear focus and warp to monitor center |
@@ -1014,7 +1014,7 @@ impl WindowManager { |
| 1014 | 1014 | .or_else(|| self.workspaces[idx].floating.last().copied()) |
| 1015 | 1015 | .or_else(|| self.workspaces[idx].tree.first_window()) |
| 1016 | 1016 | { |
| 1017 | | - self.set_focus(window)?; |
| 1017 | + self.set_focus(window, true)?; |
| 1018 | 1018 | } else { |
| 1019 | 1019 | self.focused_window = None; |
| 1020 | 1020 | self.conn.set_active_window(None)?; |
@@ -1061,7 +1061,7 @@ impl WindowManager { |
| 1061 | 1061 | .or_else(|| self.workspaces[idx].floating.last().copied()) |
| 1062 | 1062 | .or_else(|| self.workspaces[idx].tree.first_window()) |
| 1063 | 1063 | { |
| 1064 | | - self.set_focus(window)?; |
| 1064 | + self.set_focus(window, true)?; |
| 1065 | 1065 | } else { |
| 1066 | 1066 | // No windows - warp to center of monitor |
| 1067 | 1067 | self.focused_window = None; |
@@ -1171,7 +1171,7 @@ impl WindowManager { |
| 1171 | 1171 | if current_ws == self.focused_workspace { |
| 1172 | 1172 | self.focused_window = new_focus_on_current; |
| 1173 | 1173 | if let Some(new_focus) = self.focused_window { |
| 1174 | | - self.set_focus(new_focus)?; |
| 1174 | + self.set_focus(new_focus, true)?; |
| 1175 | 1175 | } else { |
| 1176 | 1176 | self.conn.set_active_window(None)?; |
| 1177 | 1177 | } |
@@ -1559,7 +1559,7 @@ impl WindowManager { |
| 1559 | 1559 | if let Some(old) = self.focused_window { |
| 1560 | 1560 | self.conn.grab_button(old)?; |
| 1561 | 1561 | } |
| 1562 | | - self.set_focus(window)?; |
| 1562 | + self.set_focus(window, true)?; |
| 1563 | 1563 | self.conn.ungrab_button(window)?; |
| 1564 | 1564 | } else { |
| 1565 | 1565 | // No windows - warp to monitor center |
@@ -1673,8 +1673,8 @@ impl WindowManager { |
| 1673 | 1673 | self.conn.grab_button(old)?; |
| 1674 | 1674 | } |
| 1675 | 1675 | |
| 1676 | | - // Focus and raise the next floating window |
| 1677 | | - self.set_focus(next_window)?; |
| 1676 | + // Focus and raise the next floating window (keyboard action, warp pointer) |
| 1677 | + self.set_focus(next_window, true)?; |
| 1678 | 1678 | self.conn.ungrab_button(next_window)?; |
| 1679 | 1679 | self.raise_window(next_window)?; |
| 1680 | 1680 | |