Implement configurable drag behaviour#2476
Open
francislavoie wants to merge 2 commits into
Open
Conversation
This was referenced Mar 22, 2026
|
hi, i face the same issue and i have confirmed that this MR fixed it, can we please put it into mainstream? thx! |
francislavoie
force-pushed
the
drag-overview-opt
branch
from
May 19, 2026 11:17
bb3ebc1 to
a6cc96f
Compare
Author
|
@charlesg99 this is ready for review, if you have the time to take a look. I've been using this locally for a couple months now and it works great. |
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.
Fixes #2087 and I think also fixes #2407 (the hot corner behaviour mentioned in there is driven by separate logic which is unaffected by these changes).
Problem
When performing an external drag-and-drop (e.g. dragging selected text or a file from one application to another while crossing the panel), any mouse contact with the panel would instantly trigger the GNOME Overview. This makes cross-monitor drag-and-drop painful, leaving the user stranded in the overview mid-drag with no clear path to their intended drop target.
Steps to reproduce
Changes
Adds three new settings to control the behavior of dragging an item over the panel.
Demo
Screencast.From.2026-03-21.21-34-35.compressed.mp4
Technical Breakdown
Two new GSettings keys:
drag-to-overview-delay(int, default-1): ms delay before activation;-1disables entirelydrag-to-overview-preview(bool, defaultfalse): show window preview popup instead of overviewappIcons.jshandleDragOver: Replaces the old immediate-activation logic with a delay-gated timeout (T7). When the xdnd source is detected: cancels panel-level timeout, clears other icons' state viacancelXdndDragTimeouts(this), simulates hover highlight (Clutter won't set it during XDnD pointer grab), and starts a one-shot timer. On fire, either opens preview popup in drag mode or falls back to activate-window/show-overview depending on window count and the preview setting._onAppIconHoverChanged: Bails out when_inXdndDragis set, preventing the normal previewrequestOpenpath from racing with the T7-managed open.cancelXdndDragTimeout: Resets T7,_xdndActionFired,_inXdndDrag, and hover state. Used as the single cleanup entry point per icon.acceptDrop: Cleans up xdnd state on drop.panel.jshandleDragOver: Gated bydrag-to-overview-delay. Usesget_actor_at_posto scope activation to the taskbar area only (ignoring clock, systray, activities, etc.). Manages a panel-level timeout (T8) guarded by_xdndPanelActionFiredto prevent re-triggering on cursor re-entry within the same drag session.drag-begin/drag-end: Registers/removes aDND.addDragMonitorfor the xdnd session. This is needed becauseXdndHandler._onPositionChangedonly callshandleDragOveron actors under the cursor — when the cursor moves off the panel to the desktop (still within GNOME Shell), no panel/icon code runs to clean up simulated hover or close previews._onXdndDragMotion: The drag monitor callback. Picks the actor under cursor and checks if it's withintaskbar.actoror the drag-modepreviewMenu.menu. If neither, clears all icon hover state and closes any drag-opened preview.acceptDrop: Cleans up panel-level xdnd state on drop.taskbar.jscancelXdndDragTimeouts(exceptIcon): Iterates all app icons callingcancelXdndDragTimeout(), optionally skipping one icon (the caller, to avoid clearing its own in-progress state).windowPreview.js_setDragMode(enabled): Toggles_dragModeon thePreviewMenuand calls_setXdndDelegateon all child previews. Activated when the preview is opened via drag (preventCloseWindow=true), cleared on close._setXdndDelegate(enabled): Assigns/removes a_delegateon eachPreviewactor withhandleDragOver/acceptDrop, making previews visible as drop targets to the GNOME Shell DND system during xdnd.handleDragOveractivates the hovered window.prefs.js/SettingsBehavior.ui-1/≥0to the singledrag-to-overview-delaykey.Disclosure
Used Github Copilot + Claude Sonnet 4.6 to make the code changes, tested locally by hand with
dbus-run-session -- gnome-shell --devkit --wayland, then had Claude Opus 4.6 do a final review pass and fix one bug I couldn't get Sonnet to fix in reasonable time.