Nested window: follow the host's size instead of being cropped
The --window backend pinned its xdg_toplevel to a fixed size (min == max == 1280x720 or --size) and ignored xdg_toplevel.configure. Whenever the host gave the window less room than that (a tiling host, a maximized/snapped window, a screen smaller than the default once its own panels and title bar are taken off), the host cropped the 1280x720 buffer and the right/bottom of the desktop, panel included, was cut off. Fullscreen only looked right when the screen happened to be at least that big. - nested: drop the max size (min 640x400), read the configure size and, on xdg_wm_base v4, configure_bounds to fit the first size on screen; report a new size through take_resize. - compositor: MoonPlasmaCompositor::resize recomputes the work area, tells clients the new wl_output mode, reflows every workspace and pulls floating windows back inside (WmState::fit_work_area), and forces a full redraw. - both main loops (wasm component and native) resize before presenting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hkYa7dkDnotDeMSdX7
This commit is contained in:
9 files changed
+220
-22
No files matched your search
@@ -221,8 +221,8 @@ fn ClientConn::close_all(self : ClientConn) -> Unit {
|
||||
pub(all) struct WaylandServer {
|
||||
socket_path : String
|
||||
listen_fd : Int
|
||||
output_w : Int
|
||||
output_h : Int
|
||||
mut output_w : Int
|
||||
mut output_h : Int
|
||||
clients : Array[ClientConn]
|
||||
win_to_client : Map[UInt64, UInt]
|
||||
mut next_client_id : UInt
|
||||
@@ -321,6 +321,31 @@ fn emit_seat_info(c : ClientConn, seat_id : UInt) -> Unit {
|
||||
c.send_msg(w2.finish_msg(seat_id, 1U))
|
||||
}
|
||||
|
||||
///| The output changed size (the nested window was resized): tell every bound wl_output.
|
||||
pub fn WaylandServer::set_output_size(self : WaylandServer, w : Int, h : Int) -> Unit {
|
||||
if w == self.output_w && h == self.output_h {
|
||||
return
|
||||
}
|
||||
self.output_w = w
|
||||
self.output_h = h
|
||||
for c in self.clients {
|
||||
if !c.alive {
|
||||
continue
|
||||
}
|
||||
for id, kind in c.objects {
|
||||
if kind is ObjOutput {
|
||||
let m = WireWriter::new()
|
||||
m.u32(3U) // current | preferred
|
||||
m.i32(w)
|
||||
m.i32(h)
|
||||
m.i32(60000)
|
||||
c.send_msg(m.finish_msg(id, 1U))
|
||||
c.send_msg(WireWriter::new().finish_msg(id, 2U)) // done
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///|
|
||||
fn emit_output_info(
|
||||
c : ClientConn,
|
||||
|
||||
Reference in new issue
Block a user