From 3d73ed0f057a555ded67ad58dbe02b36cd4d2d1f Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Tue, 24 Dec 2024 20:44:00 +0200 Subject: Accumulate wayland-crate additions: capture rendering, focus/Space sync, VT resume, plumbing Bundles the remaining wayland-crate changes built up here, touching both backends (udev and winit) and the shared input/rendering code: - udev/capture.rs: off-screen Pixman render of an arbitrary (not necessarily on-screen) workspace's window content to a PPM file -- what crates/core's capture-request queue drives, for a workspace switcher's thumbnail previews. wlr-screencopy structurally can't do this (it can only see what an output is presenting), which is why this exists as a separate render path rather than reusing it. - input::focus_window now also raises the window in smithay's own Space, not just core's stacking order - Space is what actually renders on top and what pointer hit-testing reads, so any focus path that skipped this (an IPC "focus" dispatch, concretely) left a window genuinely focused while still rendering, and receiving clicks, underneath whatever was already topmost. Both backends' poll loops now re-sync this after any IPC mutation. - udev/session.rs's VT-switch resume fix (drains a stale pending page flip before reasserting CRTCs) already has its own earlier, cleanly isolated commit - not duplicated here. - Assorted decoration/cursor/rounded-corners/output-management/ screencopy/XWayland changes and their cross-backend wiring. Coarser than the repo's usual one-purpose-per-commit convention, deliberately - see the core-crate sweep commit's own message for why. --- crates/wayland/src/state/geometry.rs | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'crates/wayland/src/state/geometry.rs') diff --git a/crates/wayland/src/state/geometry.rs b/crates/wayland/src/state/geometry.rs index c3de7fa..a0d10fa 100644 --- a/crates/wayland/src/state/geometry.rs +++ b/crates/wayland/src/state/geometry.rs @@ -28,7 +28,7 @@ impl CompState { // call for the same window (an ordinary drag/resize frame) goes // straight back to applying `geometry` immediately, as before. let anim_from = self.wm.borrow_mut().window_mut(id).and_then(|w| w.anim_from.take()); - let Some((target, decorated)) = self.wm.borrow().window(id).map(|w| (w.geometry, w.decorated)) else { return }; + let Some((target, decorated, maximized, fullscreen)) = self.wm.borrow().window(id).map(|w| (w.geometry, w.decorated, w.maximized, w.fullscreen)) else { return }; if let Some(from) = anim_from { let duration_ms = self.wm.borrow().animation_duration_ms; if from != target && duration_ms > 0 { @@ -93,6 +93,39 @@ impl CompState { state.states.set(xdg_toplevel::State::TiledRight); state.states.set(xdg_toplevel::State::TiledTop); state.states.set(xdg_toplevel::State::TiledBottom); + // Same "no configure from this compositor ever set + // this" gap as the tiled bits above, confirmed the + // same way (grepped the whole crate for `State:: + // Maximized`/`State::Fullscreen` outside foreign- + // toplevel-management, which is a *different* + // protocol read by external tools like a taskbar, + // not the client's own `xdg_toplevel` configure -- + // zero hits there before this). The window was + // resized to the full monitor rect and told it was + // tiled on every side, but never actually told via + // the real protocol mechanism for it that it was + // maximized or fullscreen at all - indistinguishable + // from an ordinary tiled-to-the-edges floating + // window as far as the client could tell. Reported + // live as fullscreen leaving a persistent gap along + // one edge (Firefox keeping some of its own chrome + // logic that specifically keys off genuinely + // *knowing* it's fullscreen, not just being resized + // to fullscreen-sized). `unset` the other explicitly + // when only one applies - `WindowManager:: + // toggle_fullscreen`/`toggle_maximize` are mutually + // exclusive, but nothing here should assume that + // holds forever just because it does today. + if maximized { + state.states.set(xdg_toplevel::State::Maximized); + } else { + state.states.unset(xdg_toplevel::State::Maximized); + } + if fullscreen { + state.states.set(xdg_toplevel::State::Fullscreen); + } else { + state.states.unset(xdg_toplevel::State::Fullscreen); + } }); top.send_configure(); } -- cgit v1.2.3