Windows: on a handset, apps open maximized and dialogs float above
Deploy to the handset / build-and-deploy (push) Successful in 2m7s
CI / test (push) Failing after 2m42s

- Apps open maximized on a touchscreen whose short side is under 720px. Restore gives a floating window that fits the screen.
- Maximized windows can't be dragged or resized.
- Dialogs (xdg_toplevel.set_parent) open floating and centered, and stay above their app when it is activated.
- Under tiling, the last used app is drawn on top.
- Add transient_for to WmState and make inner_work_area and fit_rect public for the compositor.
- Tests cover maximized opening, dialog stacking, drag suppression and restore.
- Document the handset window behavior in docs/handset.md.
This commit is contained in:
nandi committed 2026-11-29 23:11:34 -08:00
1 parent 7029c92e6e
commit 5c83cdaa22
5 files changed
+148 -10

No files matched your search

+22 -1
View File
@@ -175,6 +175,8 @@ struct ToplevelState {
mut opened_sent : Bool
/// xdg_toplevel.set_parent named another toplevel: a dialog or tool window of its app.
mut has_parent : Bool
/// That toplevel's window.
mut parent_win : UInt64?
/// Set for xdg_popup surfaces (they live in `toplevels` so input routing is shared).
popup_parent : UInt64?
/// The last xdg_toplevel.configure sent: size, states and its xdg_surface serial (0 = none).
@@ -1310,6 +1312,7 @@ fn WaylandServer::dispatch_msg(
min_h: 120,
opened_sent: false,
has_parent: false,
parent_win: None,
popup_parent: None,
cfg_w: 0,
cfg_h: 0,
@@ -1378,6 +1381,7 @@ fn WaylandServer::dispatch_msg(
min_h: 1,
opened_sent: true,
has_parent: true,
parent_win: Some(parent_wid),
popup_parent: Some(parent_wid),
cfg_w: 0,
cfg_h: 0,
@@ -1481,7 +1485,12 @@ fn WaylandServer::dispatch_msg(
events.push(ToplevelClosed(wid))
} else if opcode == 1U {
// set_parent(parent: object or null)
tl.has_parent = reader.u32() != 0U
let parent = reader.u32()
tl.has_parent = parent != 0U
tl.parent_win = match c.objects.get(parent) {
Some(ObjXdgToplevel(w)) => Some(w)
_ => None
}
} else if opcode == 2U {
// set_title
tl.title = reader.str()
@@ -1767,6 +1776,18 @@ pub fn WaylandServer::toplevel_has_parent(self : WaylandServer, win_id : UInt64)
}
}
///| The window a dialog belongs to (xdg_toplevel.set_parent).
pub fn WaylandServer::toplevel_parent(self : WaylandServer, win_id : UInt64) -> UInt64? {
match self.win_client(win_id) {
Some((c, _)) =>
match c.toplevels.get(win_id) {
Some(tl) => tl.parent_win
None => None
}
None => None
}
}
///| Send xdg_toplevel.configure + xdg_surface.configure to a client window.
pub fn WaylandServer::send_toplevel_configure(
self : WaylandServer,