-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
Open
Labels
pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-tkintertype-featureA feature request or enhancementA feature request or enhancement
Description
I had issues with multiple windows. My initial widget and my destination widget were different top level windows.
This solution worked well and I can't think of any reason it would break the existing code. Would be good to check if a valid widget first.
tested. ish...
--- dnd.py 2026-01-04 20:08:11.713697389 -0800
+++ ../dnd.py 2026-01-04 20:10:04.273009496 -0800
@@ -151,7 +151,7 @@
def on_motion(self, event):
x, y = event.x_root, event.y_root
- target_widget = self.initial_widget.winfo_containing(x, y)
+ target_widget = event.widget.winfo_toplevel().winfo_containing(x, y)
source = self.source
new_target = None
while target_widget is not None:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-tkintertype-featureA feature request or enhancementA feature request or enhancement