Previously, drag placeholder would be removed in the call to
`tiling_layer.drop_window()` when dropping onto a tiling layer, but
would not be removed when dropping to a floating layer. Which would
leave a placeholder taking up space, and cause a panic on a future drag
operation.
Instead, call `cleanup_drag()` regardless, after `drop_window()`, to do
any cleanup that is still needed. This moves the call that was
previously added in 67d0a825.
Since `copy_clone()` preserved IDs, `traverse_pre_order_ids()` can be
called on the old tree, without collecting into a `Vec`.
Then we can also `copy_clone()` only if there's actually a change, and
also only call `push_tree()` in that case.
(Once the `LazyCell::get()` stabilization is released, we could use
that here, but `Option::get_or_insert_with()` may be more readable
anyway.)
With this, `cleanup_drag()` should be pretty low-cost, so we shouldn't
have to worry about whether or not it's redundant.
This doesn't change much, since the Smithay implementation is based on
the `cosmic-comp` version, but made more generic. We provide our own
implementation for our workspace capture protocol, but otherwise Smithay
handles the boilerplate now.
This should not cause any change in behavior.
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