From be5c4efa6866b5d23e1e81ecfc3b8d276540860f Mon Sep 17 00:00:00 2001 From: srdusr <99972264+srdusr@users.noreply.github.com> Date: Fri, 29 Aug 2025 22:42:00 +0200 Subject: Core window manager: real fixes plus three new rule/placement primitives Several independent, real pieces landed in crates/core this shift - see docs/TODO.md for each one's full root-cause/verification narrative: - "Primary" monitor is now picked by which head sits at physical (0, 0) (the user's own configured anchor), not whichever connector DRM happened to probe first - fixes desktop icons and new-window placement landing on the wrong monitor depending on hotplug/probe order. - A new window's target monitor now prioritizes the pointer's own current monitor over the last-focused window's monitor, which goes stale the moment the user's attention moves to empty desktop, a panel, or a dock. - aspect_ratio window-rule action ("W:H") plus ResizeEdge::apply_aspect_ ratio: holds a floating window's aspect ratio through an interactive resize. The real, scoped "phone monitor" primitive - matches any VM/ emulator/scrcpy window by app_id, nothing Android- or VM-specific here. - general.phone_mode (WindowManager::phone_mode): a new window defaults to maximized instead of floating/tiled small, unless a rule explicitly floats it or sets maximized - the one placement default a phone-shaped screen actually needs. Exposed read-only via IPC so a shell panel can adapt its own chrome to the same signal. - input_pin.rs: the core half of pinning a virtual pointer to a specific window (Multi-cursor Phase 2) - a backend-agnostic request queue, same cross-boundary shape output_position_requests/lock_requested already use, since core has no real Wayland protocol object to reach into itself. Full workspace test suite covers all of the above (aspect-ratio resize math for every edge case, phone-mode default-vs-rule-override behavior, the pin-input request queue, the monitor-picking fixes). --- crates/core/src/rules.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/core/src/rules.rs') diff --git a/crates/core/src/rules.rs b/crates/core/src/rules.rs index ec096be..ea83501 100644 --- a/crates/core/src/rules.rs +++ b/crates/core/src/rules.rs @@ -94,6 +94,12 @@ pub struct WindowRuleActions { /// Per-window resize-grab-margin override, in logical pixels /// (Hyprland's per-window `extend_border_grab_area`). pub resize_margin: Option, + /// `(width, height)` ratio to hold while resizing - see `Window:: + /// aspect_ratio`'s own doc comment for the "phone monitor" use case + /// this exists for. Parsed from a `"9:16"`-shaped string by the Lua + /// binding (`crates/config`), not here - this crate has no config + /// engine of its own to own that parsing. + pub aspect_ratio: Option<(u32, u32)>, } #[derive(Debug, Clone, Default)] -- cgit v1.2.3