@@ -535,21 +535,17 @@ impl WindowManager { |
| 535 | 535 | |
| 536 | 536 | // Focus the clicked window |
| 537 | 537 | if self.focused_window != Some(window) { |
| 538 | | - // Regrab button on old focused window (unless it's floating - keep grab for edge resize) |
| 538 | + // Regrab button on old focused window for click-to-focus |
| 539 | 539 | if let Some(old) = self.focused_window { |
| 540 | | - if !self.is_floating(old) { |
| 541 | | - self.conn.grab_button(old)?; |
| 542 | | - } |
| 540 | + self.conn.grab_button(old)?; |
| 543 | 541 | } |
| 544 | 542 | |
| 545 | 543 | // Set focus |
| 546 | 544 | self.set_focus(window, false)?; |
| 547 | 545 | |
| 548 | | - // For non-floating windows, ungrab button for click-through |
| 549 | | - // For floating windows, keep grab for edge resize detection |
| 550 | | - if !self.is_floating(window) { |
| 551 | | - self.conn.ungrab_button(window)?; |
| 552 | | - } |
| 546 | + // Ungrab buttons so clicks pass through to the application |
| 547 | + // Edge resize detection uses POINTER_MOTION events, not button grabs |
| 548 | + self.conn.ungrab_button(window)?; |
| 553 | 549 | |
| 554 | 550 | // Raise floating windows on focus |
| 555 | 551 | if self.is_floating(window) { |
@@ -2074,9 +2070,10 @@ impl WindowManager { |
| 2074 | 2070 | | EventMask::POINTER_MOTION, |
| 2075 | 2071 | )?; |
| 2076 | 2072 | |
| 2077 | | - // Re-establish button grabs for edge resize detection |
| 2078 | | - // (buttons may have been ungrabbed when the window was focused as tiled) |
| 2079 | | - self.conn.grab_button(window)?; |
| 2073 | + // Don't grab buttons - the window is already focused (we're acting on focused window) |
| 2074 | + // and grabbing would intercept all clicks, preventing app interaction. |
| 2075 | + // Mod+button grabs on root handle floating move/resize. |
| 2076 | + // Button grabs are only for click-to-focus on unfocused windows. |
| 2080 | 2077 | |
| 2081 | 2078 | // Add to floating list (on top) |
| 2082 | 2079 | self.current_workspace_mut().add_floating(window); |