Previously, `unmap_surface` automatically pushed all unmapped windows
into the `pending_windows` list. This behavior is correct for X11
windows (which may be remapped) but incorrect for Wayland `toplevel_destroyed`
events, where the role is permanently gone.
This caused issues with clients like Telegram that reuse `wl_surface`s.
Because the destroyed toplevel remained in `pending_windows`, a
subsequent cleanup commit (e.g., null buffer) triggered a configure
event. This prematurely marked the surface as `configured` in the
shell state.
Consequently, when the client attached a new `xdg_toplevel` role,
the compositor skipped the mandatory initial configure event (assuming
it was already done), causing the window to never appear.
This refactors `unmap_surface` to return `Option<PendingWindow>`
instead of mutating global state.
- XWayland: Explicitly saves the pending window (behavior preserved).
- XDG Shell: Drops the pending window, preventing ghost state interactions.
Fixes#1816
This protocol is now the upstream solution in at-spi2-core/orca for
registering keyboard grabs and watching key events. It should also be a
bit better than the current verious of our custom Wayland protocol for
this purpose.
Like Mutter and Kwin, we currently restrict this to only be called by
the client that holds the name `org.gnome.Orca.KeyboardMonitor` on the
session bus. We also send the `KeyEvent` signal only to registered
watchers, rather than broadcasting, as DBus does by default.
This seems for an SDL XWayland client to restore fullscreen after
unminimize, it needs to see the `_NET_WM_STATE_HIDDEN` state get set
and unset.
In general `_NET_WM_STATE_HIDDEN` does not seem to cover all the
cases covered by waylands "suspended" state, so let's not equate them.
https://github.com/pop-os/cosmic-comp/issues/1510
Replacement for https://github.com/pop-os/cosmic-comp/pull/1687, that
works correctly with multiple outputs.
We don't want another window to show a focus indicator while a window is
being dragged, so keep the window in the focus stack. If a window is
being moved out of a stack, change the focus from the stack to the
window.
`refresh_focus_stack()` doesn't seem to be called here, but for good
measure, make sure that calling that function also won't remove a
`CosmicMapped` from the focus stack if it is currently part of a move
grab for the seat.
`Action::Close` already used the keyboard focus target, but some other
bindings didn't. Presumably it's most intuitive if all "current window"
key bindings affect the window with keyboard focus.
These used the focus stack on the `focused_output()` (the one with
keyboard focus), so I guess the main impact is when the keyboard target
is a window being dragged? Then the binding will operate on that window,
or have no effect.
This seems related to some of the behaviors discussed in
https://github.com/pop-os/cosmic-comp/issues/453.
This seems like the correct way to use an `IndexSet`. It shouldn't be
possible to have multiple entries that match, since it's a "set".
We can't define `Borrow<CosmicMapped> for FocusTarget`, so the blanket
impl of `indexmap::Equivalent` won't work, but implementing seems fine.
This is a first use of the new hooks system, which allows customizing
cosmic-comp at compile-time.
In this case, the view() function of CosmicWindow / CosmicStack is
hooked and the hook can change what is rendered as the header bar.
Signed-off-by: Yureka <yuka@yuka.dev>