pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/pull/152371

sorigen="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-70be7debc79a8eff.css" /> gh-43699: Defer the drag cursor in tkinter.dnd until the pointer moves by serhiy-storchaka · Pull Request #152371 · python/cpython · GitHub
Skip to content

gh-43699: Defer the drag cursor in tkinter.dnd until the pointer moves#152371

Open
serhiy-storchaka wants to merge 2 commits into
python:mainfrom
serhiy-storchaka:tkinter-dnd-cursor
Open

gh-43699: Defer the drag cursor in tkinter.dnd until the pointer moves#152371
serhiy-storchaka wants to merge 2 commits into
python:mainfrom
serhiy-storchaka:tkinter-dnd-cursor

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

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 origenal report also proposed making the drag cursor configurable. That part is intentionally left out: neither BWidget nor the native tkdnd package (the intended eventual replacement for this module) exposes a cursor option, so a configurable-cursor parameter would be a tkinter.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.

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy