-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drag and drop windows while navigating #259
Closed
Closed
Conversation
This file contains 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
This is much more flexible: we can drag windows across workspaces in the carousel, react on keybindings, scroll, etc.
…ting workspace switch This simplifies code moving windows between workspaces without messing with the focus. (since mutter enforce focus_window.workspace == active_workspace) Mainly preparation for DnD fixes in the next commit.
- delay workspace change until DnD end (partial Navigator destroy) - sync scratch window frame with clone on grab end Bug in the wip commit fixed: (focus was not always preserved on workspace dnd) - DnD a window - switch to a different workspace using the workspace carousel - drop the window -> the DnD-window loose focus on workspace change (in step 2) Note: Mutter enforce focus_window.workspace === active_workspace, changing focus window if necessary.
Use get_pointer, and transform_stage_point for to get correct coordinates...
For some reason this is accurate
- Activate destination workspace if it isn't active, fake it if not. If a «stuck» window have focus, consider it selected. If selected window or one its transient window has focus, fake focus handler. Otherwise activate it.
Precreated zones doesn't work when the user can alter the space during grab. (eg. resize a window or insert new ones) TODO: handle empty spaces
(only works properly in wayland)
This is necessary for events to pass through to the space.
This is a bit ugly, should probably have a proper method for this.
…also) (only works properly in wayland)
Also move zone actor creation to zone activation. (regression after "dnd: create zones and actors on the fly")
When ending a grab we want to have full control over what space and window gains focus. So simply pass the window through navigator.finish in addition to the space.
The clutter reported modifier state is easily stuck on X11: - Enter "clutter mode". Press and hold ctrl whild exiting (usually ctrl-ecs) - Clutter will now report ctrl after ctrl is released causing windows to go directly to dnd mode when moved.
The `global.get_pointer` is not necessarily in sync with the clutter motion event. We use `global.get_pointer` to set the anchor in `begin`, but sometimes (fast motions more likely to trigger) it's an extra event in the `motion` event queue. The motion handler will in effect see a reality that occured before the anchor was set, triggering a "jump". Also notice that `global.get_pointer` seems to be ahead of the actual grab event :/ meaning we get less responsive window moving. We don't have access the actual click coordinates which triggered the move :(
Closed
All of these commits are already in |
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.
Mutter's window grab blocks all other input, but it's possible to deactivate a grab from js.
So to make navigation while dragging work we implement the whole process using clone's and clutter events. The native
grab-op-begin
signal is only used to initiate a grab (we can't listen to arbitrary button events on WindowActors) which we immediately cancel in favor of the before mentioned implementation.In addition to navigation while grabbing, we now support
<super><ctrl>button-press
as a shortcut to go straight into DnD mode. This can be very handy when you want to move a floating window into the tiling.