Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the staging protocol xdg-toplevel-drag-v1 (
xdg_toplevel_drag_manager_v1). A client attaches a toplevel to thewl_data_sourceof a drag, and the compositor moves that window with the pointer until the drag ends. Browsers and toolkits use it to tear a tab off into a new window and to dock it back: Chromium and Qt use it, and KWin implements it.The window moves through the same code as an interactive move. The first commit splits that code out of
MoveSurfaceGrabinto aWindowMovethat does not depend on a pointer grab. A config therefore getsonWindowMoveevents with the new source"toplevel-drag", and its snapping, tiling and workspace rules apply as for a title bar drag. Without a move handler, the window is placed in the space directly, as before.start_dragor fromattach, whichever comes last.endevent).invalid_sourcefor a second drag object on one source,toplevel_attachedfor an attach over a live attached toplevel,ongoing_dragfor a destroy during the drag.smithay's
DnDGrabis wrapped in a smallToplevelDragGrabthat moves the window on each motion before the DnD grab sees it, so the smithay fork does not change. The bindings come from thewayland-protocolsversion already in Cargo.lock (featurestaging).Tested with unit tests for the state of a drag object (attach before and during the drag, drop, detach on unmap, the error cases) and
tests/toplevel_drag.rsin shojiwm_rs, which runs a backendless compositor with a real Wayland client:enterand thedropalthough the dragged window covers the pointer, and the window stays where it was dropped. Destroying the drag object after the drop raises no error.cargo test --workspace --all-targetspasses exceptvirtual_keyboard_binds::input_method_keyboard_grab_gets_the_keymap_of_the_keys_it_is_sent, which fails the same way on main on this machine.npm run typecheckpasses. Not tried with a browser yet.