Clicking a window raises it: go through the WM's Activate so stacking order changes
CI / test (push) Failing after 34s

Window clicks, title-bar drags, resize grabs and focus handoff after close emitted Focus/Raise
directly; Raise only marked damage, so the WM's floating order never changed and a focused
window could stay drawn under another. They now use handle_request(Activate) (activate_window).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Sonnet 5.5 committed 2026-11-25 03:11:58 -08:00
1 parent 69a163bc08
commit 4b99b0063e
2 files changed
+33 -7

No files matched your search

+12 -7
View File
@@ -756,7 +756,7 @@ fn MoonPlasmaCompositor::press_title_button(
let order = self.wm.stacking_order()
if order.length() > 0 {
let top = order[order.length() - 1]
self.apply_actions([@wm.WmAction::Focus(top), @wm.WmAction::Raise(top)])
self.activate_window(top)
} else {
self.set_kbd_focus(None)
}
@@ -764,6 +764,14 @@ fn MoonPlasmaCompositor::press_title_button(
self.damage.mark_full()
}
///| Focus a window and bring it to the front through the window manager, so its stacking
/// order (not just the drawing) changes.
fn MoonPlasmaCompositor::activate_window(self : MoonPlasmaCompositor, wid : UInt64) -> Unit {
self.apply_actions(
self.wm.handle_request(wid, @wm.WindowRequest::Activate, self.work_area),
)
}
///| Restore a minimized window (or focus a visible one) from its task-bar pill.
fn MoonPlasmaCompositor::activate_task(self : MoonPlasmaCompositor, wid : UInt64) -> Unit {
let minimized = match self.wm.windows.get(wid) {
@@ -999,7 +1007,7 @@ pub fn MoonPlasmaCompositor::handle_input(
if button == 272U && self.resize_at(xi, yi) is None {
// Drag the window by its title bar; a tiled window becomes floating first.
self.leave_pointer()
self.apply_actions([@wm.WmAction::Focus(wid), @wm.WmAction::Raise(wid)])
self.activate_window(wid)
self.apply_actions(self.wm.float_window(wid, self.work_area))
ignore(self.wm.start_drag(wid, @wm.DragMode::Move, xi, yi))
return
@@ -1011,7 +1019,7 @@ pub fn MoonPlasmaCompositor::handle_input(
match self.resize_at(xi, yi) {
Some((wid, mode)) => {
self.leave_pointer()
self.apply_actions([@wm.WmAction::Focus(wid), @wm.WmAction::Raise(wid)])
self.activate_window(wid)
ignore(self.wm.start_drag(wid, mode, xi, yi))
return
}
@@ -1032,10 +1040,7 @@ pub fn MoonPlasmaCompositor::handle_input(
}
match self.window_at(xi, yi) {
Some((wid, _)) => {
self.apply_actions([
@wm.WmAction::Focus(wid),
@wm.WmAction::Raise(wid),
])
self.activate_window(wid)
}
None => ()
}