gh-43699: Defer the drag cursor in tkinter.dnd until the pointer moves#152371
Open
serhiy-storchaka wants to merge 2 commits into
Open
gh-43699: Defer the drag cursor in tkinter.dnd until the pointer moves#152371serhiy-storchaka wants to merge 2 commits into
serhiy-storchaka wants to merge 2 commits into
Conversation
…r moves The drag cursor is now changed only once the pointer starts moving past a small threshold rather than on the initial button press, so that a plain click no longer flashes it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts: # Lib/test/test_tkinter/test_dnd.py
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.
The drag cursor was applied to the source widget as soon as the button was pressed, in
DndHandler.__init__(). As a result a plain click (a press and release with no motion) briefly flashed the drag cursor, even though no drag-and-drop actually took place.The cursor is now changed only once the pointer has moved past a small threshold, so that a plain click no longer flashes it. This matches BWidget's pure-Tcl drag-and-drop, which likewise shows drag feedback only after a few pixels of motion.
The original report also proposed making the drag cursor configurable. That part is intentionally left out: neither BWidget nor the native
tkdndpackage (the intended eventual replacement for this module) exposes a cursor option, so a configurable-cursor parameter would be atkinter.dnd-only knob with no precedent and no successor. An application that wants its own cursor can already set it from the drag-and-drop callbacks.This is a behavior change with no new API, so it targets the main branch only.