Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
0.6.3
- Fixed drag-over stalls (sometimes lasting several seconds to a
minute) while dragging files/text over a drop target on Linux/X11,
most noticeable under XWayland. The XDND position handler was
fetching the full dropped-data selection on every pointer motion
while hovering, even when nothing used it; it's now only fetched
when a bound <<DropEnter>>/<<DropPosition>> binding actually
references it, and the result is cached per hovered target instead
of being re-fetched on every mouse-move. This also shrinks the
window for a state race with drag-leave handling that could
intermittently make a drop silently produce no data. Related to
issues #16 and #20.

0.6.2
- Rebuilt the Linux binaries (linux-x64(-tcl9) and linux-arm64(-tcl9)) from
TkDND 2.10.1 to pick up a fix for a race condition in the X11
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="tkinterdnd2",
version="0.6.2",
version="0.6.3",
author="petasis\\pmgagne\\eliav2\\squiblydoo",
description="TkinterDnD2 is a python wrapper for George Petasis'' tkDnD Tk extension version 2",
long_description=long_description,
Expand Down
Binary file not shown.
8 changes: 4 additions & 4 deletions tkinterdnd2/tkdnd/linux-arm64-tcl9/pkgIndex.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ namespace eval ::tkdnd {

}; # namespace ::tkdnd

package ifneeded tkdnd 2.10.1 \
package ifneeded tkdnd 2.10.2 \
"tkdnd::source \{$dir/tkdnd.tcl\} ; \
tkdnd::initialise \{$dir\} libtcl9tkdnd2.10.1.so tkdnd"
tkdnd::initialise \{$dir\} libtcl9tkdnd2.10.2.so tkdnd"

package ifneeded tkdnd::utils 2.10.1 \
package ifneeded tkdnd::utils 2.10.2 \
"tkdnd::source \{$dir/tkdnd_utils.tcl\} ; \
package provide tkdnd::utils 2.10.1"
package provide tkdnd::utils 2.10.2"
35 changes: 32 additions & 3 deletions tkinterdnd2/tkdnd/linux-arm64-tcl9/tkdnd_unix.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ proc xdnd::HandleXdndEnter { drop_target drag_source typelist time
variable _pressedkeys
variable _actionlist
variable _typelist
variable _position_data_target; set _position_data_target {}
variable _position_data_cache; set _position_data_cache {}
set _pressedkeys [GetPressedKeys $drop_target]
set _actionlist { copy move link ask private }
set _typelist $typelist
Expand All @@ -101,17 +103,42 @@ proc xdnd::HandleXdndEnter { drop_target drag_source typelist time
# ----------------------------------------------------------------------------
# Command xdnd::HandleXdndPosition
# ----------------------------------------------------------------------------
proc xdnd::NeedsPositionData { resolved_target } {
foreach event {<<DropEnter>> <<DropPosition>>} {
if {[string first %D [bind $resolved_target $event]] >= 0} { return 1 }
}
return 0
};# xdnd::NeedsPositionData

proc xdnd::HandleXdndPosition { drop_target rootX rootY time
{ drag_source {} } { action default } } {
variable _pressedkeys
variable _typelist
variable _last_mouse_root_x; set _last_mouse_root_x $rootX
variable _last_mouse_root_y; set _last_mouse_root_y $rootY
variable _position_data_target
variable _position_data_cache
set _pressedkeys [GetPressedKeys $drop_target]
#DBG debug "xdnd::HandleXdndPosition: $time"
## Get the dropped data...
catch {
::tkdnd::generic::SetDroppedData [GetPositionData $drop_target $_typelist $time]
## The dropped data can't change for the life of a drag, so only pay for
## the (possibly multi-second, per candidate type) selection round-trip
## once per hovered target, and only if a bound <<DropEnter>>/<<DropPosition>>
## script actually uses %D. Doing this unconditionally on every pointer
## motion is what causes drag-over stalls and races with HandleLeave (see
## the snapshot/restore comment in HandleXdndDrop above).
foreach {resolved common_drag_source_types common_drop_target_types} \
[::tkdnd::generic::FindWindowWithCommonTypes $drop_target $_typelist] {break}
if {[string length $resolved] && [NeedsPositionData $resolved]} {
if {![info exists _position_data_target] ||
$_position_data_target ne $resolved} {
set _position_data_target $resolved
set _position_data_cache {}
catch {set _position_data_cache [GetPositionData $drop_target $_typelist $time]}
}
::tkdnd::generic::SetDroppedData $_position_data_cache
} else {
set _position_data_target {}
::tkdnd::generic::SetDroppedData {}
}
::tkdnd::generic::HandlePosition $drop_target $drag_source \
$_pressedkeys $rootX $rootY $action
Expand All @@ -121,6 +148,8 @@ proc xdnd::HandleXdndPosition { drop_target rootX rootY time
# Command xdnd::HandleXdndLeave
# ----------------------------------------------------------------------------
proc xdnd::HandleXdndLeave { } {
variable _position_data_target; set _position_data_target {}
variable _position_data_cache; set _position_data_cache {}
#DBG debug "xdnd::HandleXdndLeave"
::tkdnd::generic::HandleLeave
};# xdnd::HandleXdndLeave
Expand Down
Binary file not shown.
8 changes: 4 additions & 4 deletions tkinterdnd2/tkdnd/linux-arm64/pkgIndex.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ namespace eval ::tkdnd {

}; # namespace ::tkdnd

package ifneeded tkdnd 2.10.1 \
package ifneeded tkdnd 2.10.2 \
"tkdnd::source \{$dir/tkdnd.tcl\} ; \
tkdnd::initialise \{$dir\} libtkdnd2.10.1.so tkdnd"
tkdnd::initialise \{$dir\} libtkdnd2.10.2.so tkdnd"

package ifneeded tkdnd::utils 2.10.1 \
package ifneeded tkdnd::utils 2.10.2 \
"tkdnd::source \{$dir/tkdnd_utils.tcl\} ; \
package provide tkdnd::utils 2.10.1"
package provide tkdnd::utils 2.10.2"
35 changes: 32 additions & 3 deletions tkinterdnd2/tkdnd/linux-arm64/tkdnd_unix.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ proc xdnd::HandleXdndEnter { drop_target drag_source typelist time
variable _pressedkeys
variable _actionlist
variable _typelist
variable _position_data_target; set _position_data_target {}
variable _position_data_cache; set _position_data_cache {}
set _pressedkeys [GetPressedKeys $drop_target]
set _actionlist { copy move link ask private }
set _typelist $typelist
Expand All @@ -101,17 +103,42 @@ proc xdnd::HandleXdndEnter { drop_target drag_source typelist time
# ----------------------------------------------------------------------------
# Command xdnd::HandleXdndPosition
# ----------------------------------------------------------------------------
proc xdnd::NeedsPositionData { resolved_target } {
foreach event {<<DropEnter>> <<DropPosition>>} {
if {[string first %D [bind $resolved_target $event]] >= 0} { return 1 }
}
return 0
};# xdnd::NeedsPositionData

proc xdnd::HandleXdndPosition { drop_target rootX rootY time
{ drag_source {} } { action default } } {
variable _pressedkeys
variable _typelist
variable _last_mouse_root_x; set _last_mouse_root_x $rootX
variable _last_mouse_root_y; set _last_mouse_root_y $rootY
variable _position_data_target
variable _position_data_cache
set _pressedkeys [GetPressedKeys $drop_target]
#DBG debug "xdnd::HandleXdndPosition: $time"
## Get the dropped data...
catch {
::tkdnd::generic::SetDroppedData [GetPositionData $drop_target $_typelist $time]
## The dropped data can't change for the life of a drag, so only pay for
## the (possibly multi-second, per candidate type) selection round-trip
## once per hovered target, and only if a bound <<DropEnter>>/<<DropPosition>>
## script actually uses %D. Doing this unconditionally on every pointer
## motion is what causes drag-over stalls and races with HandleLeave (see
## the snapshot/restore comment in HandleXdndDrop above).
foreach {resolved common_drag_source_types common_drop_target_types} \
[::tkdnd::generic::FindWindowWithCommonTypes $drop_target $_typelist] {break}
if {[string length $resolved] && [NeedsPositionData $resolved]} {
if {![info exists _position_data_target] ||
$_position_data_target ne $resolved} {
set _position_data_target $resolved
set _position_data_cache {}
catch {set _position_data_cache [GetPositionData $drop_target $_typelist $time]}
}
::tkdnd::generic::SetDroppedData $_position_data_cache
} else {
set _position_data_target {}
::tkdnd::generic::SetDroppedData {}
}
::tkdnd::generic::HandlePosition $drop_target $drag_source \
$_pressedkeys $rootX $rootY $action
Expand All @@ -121,6 +148,8 @@ proc xdnd::HandleXdndPosition { drop_target rootX rootY time
# Command xdnd::HandleXdndLeave
# ----------------------------------------------------------------------------
proc xdnd::HandleXdndLeave { } {
variable _position_data_target; set _position_data_target {}
variable _position_data_cache; set _position_data_cache {}
#DBG debug "xdnd::HandleXdndLeave"
::tkdnd::generic::HandleLeave
};# xdnd::HandleXdndLeave
Expand Down
Binary file not shown.
8 changes: 4 additions & 4 deletions tkinterdnd2/tkdnd/linux-x64-tcl9/pkgIndex.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ namespace eval ::tkdnd {

}; # namespace ::tkdnd

package ifneeded tkdnd 2.10.1 \
package ifneeded tkdnd 2.10.2 \
"tkdnd::source \{$dir/tkdnd.tcl\} ; \
tkdnd::initialise \{$dir\} libtcl9tkdnd2.10.1.so tkdnd"
tkdnd::initialise \{$dir\} libtcl9tkdnd2.10.2.so tkdnd"

package ifneeded tkdnd::utils 2.10.1 \
package ifneeded tkdnd::utils 2.10.2 \
"tkdnd::source \{$dir/tkdnd_utils.tcl\} ; \
package provide tkdnd::utils 2.10.1"
package provide tkdnd::utils 2.10.2"
35 changes: 32 additions & 3 deletions tkinterdnd2/tkdnd/linux-x64-tcl9/tkdnd_unix.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ proc xdnd::HandleXdndEnter { drop_target drag_source typelist time
variable _pressedkeys
variable _actionlist
variable _typelist
variable _position_data_target; set _position_data_target {}
variable _position_data_cache; set _position_data_cache {}
set _pressedkeys [GetPressedKeys $drop_target]
set _actionlist { copy move link ask private }
set _typelist $typelist
Expand All @@ -101,17 +103,42 @@ proc xdnd::HandleXdndEnter { drop_target drag_source typelist time
# ----------------------------------------------------------------------------
# Command xdnd::HandleXdndPosition
# ----------------------------------------------------------------------------
proc xdnd::NeedsPositionData { resolved_target } {
foreach event {<<DropEnter>> <<DropPosition>>} {
if {[string first %D [bind $resolved_target $event]] >= 0} { return 1 }
}
return 0
};# xdnd::NeedsPositionData

proc xdnd::HandleXdndPosition { drop_target rootX rootY time
{ drag_source {} } { action default } } {
variable _pressedkeys
variable _typelist
variable _last_mouse_root_x; set _last_mouse_root_x $rootX
variable _last_mouse_root_y; set _last_mouse_root_y $rootY
variable _position_data_target
variable _position_data_cache
set _pressedkeys [GetPressedKeys $drop_target]
#DBG debug "xdnd::HandleXdndPosition: $time"
## Get the dropped data...
catch {
::tkdnd::generic::SetDroppedData [GetPositionData $drop_target $_typelist $time]
## The dropped data can't change for the life of a drag, so only pay for
## the (possibly multi-second, per candidate type) selection round-trip
## once per hovered target, and only if a bound <<DropEnter>>/<<DropPosition>>
## script actually uses %D. Doing this unconditionally on every pointer
## motion is what causes drag-over stalls and races with HandleLeave (see
## the snapshot/restore comment in HandleXdndDrop above).
foreach {resolved common_drag_source_types common_drop_target_types} \
[::tkdnd::generic::FindWindowWithCommonTypes $drop_target $_typelist] {break}
if {[string length $resolved] && [NeedsPositionData $resolved]} {
if {![info exists _position_data_target] ||
$_position_data_target ne $resolved} {
set _position_data_target $resolved
set _position_data_cache {}
catch {set _position_data_cache [GetPositionData $drop_target $_typelist $time]}
}
::tkdnd::generic::SetDroppedData $_position_data_cache
} else {
set _position_data_target {}
::tkdnd::generic::SetDroppedData {}
}
::tkdnd::generic::HandlePosition $drop_target $drag_source \
$_pressedkeys $rootX $rootY $action
Expand All @@ -121,6 +148,8 @@ proc xdnd::HandleXdndPosition { drop_target rootX rootY time
# Command xdnd::HandleXdndLeave
# ----------------------------------------------------------------------------
proc xdnd::HandleXdndLeave { } {
variable _position_data_target; set _position_data_target {}
variable _position_data_cache; set _position_data_cache {}
#DBG debug "xdnd::HandleXdndLeave"
::tkdnd::generic::HandleLeave
};# xdnd::HandleXdndLeave
Expand Down
Binary file not shown.
8 changes: 4 additions & 4 deletions tkinterdnd2/tkdnd/linux-x64/pkgIndex.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ namespace eval ::tkdnd {

}; # namespace ::tkdnd

package ifneeded tkdnd 2.10.1 \
package ifneeded tkdnd 2.10.2 \
"tkdnd::source \{$dir/tkdnd.tcl\} ; \
tkdnd::initialise \{$dir\} libtkdnd2.10.1.so tkdnd"
tkdnd::initialise \{$dir\} libtkdnd2.10.2.so tkdnd"

package ifneeded tkdnd::utils 2.10.1 \
package ifneeded tkdnd::utils 2.10.2 \
"tkdnd::source \{$dir/tkdnd_utils.tcl\} ; \
package provide tkdnd::utils 2.10.1"
package provide tkdnd::utils 2.10.2"
35 changes: 32 additions & 3 deletions tkinterdnd2/tkdnd/linux-x64/tkdnd_unix.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ proc xdnd::HandleXdndEnter { drop_target drag_source typelist time
variable _pressedkeys
variable _actionlist
variable _typelist
variable _position_data_target; set _position_data_target {}
variable _position_data_cache; set _position_data_cache {}
set _pressedkeys [GetPressedKeys $drop_target]
set _actionlist { copy move link ask private }
set _typelist $typelist
Expand All @@ -101,17 +103,42 @@ proc xdnd::HandleXdndEnter { drop_target drag_source typelist time
# ----------------------------------------------------------------------------
# Command xdnd::HandleXdndPosition
# ----------------------------------------------------------------------------
proc xdnd::NeedsPositionData { resolved_target } {
foreach event {<<DropEnter>> <<DropPosition>>} {
if {[string first %D [bind $resolved_target $event]] >= 0} { return 1 }
}
return 0
};# xdnd::NeedsPositionData

proc xdnd::HandleXdndPosition { drop_target rootX rootY time
{ drag_source {} } { action default } } {
variable _pressedkeys
variable _typelist
variable _last_mouse_root_x; set _last_mouse_root_x $rootX
variable _last_mouse_root_y; set _last_mouse_root_y $rootY
variable _position_data_target
variable _position_data_cache
set _pressedkeys [GetPressedKeys $drop_target]
#DBG debug "xdnd::HandleXdndPosition: $time"
## Get the dropped data...
catch {
::tkdnd::generic::SetDroppedData [GetPositionData $drop_target $_typelist $time]
## The dropped data can't change for the life of a drag, so only pay for
## the (possibly multi-second, per candidate type) selection round-trip
## once per hovered target, and only if a bound <<DropEnter>>/<<DropPosition>>
## script actually uses %D. Doing this unconditionally on every pointer
## motion is what causes drag-over stalls and races with HandleLeave (see
## the snapshot/restore comment in HandleXdndDrop above).
foreach {resolved common_drag_source_types common_drop_target_types} \
[::tkdnd::generic::FindWindowWithCommonTypes $drop_target $_typelist] {break}
if {[string length $resolved] && [NeedsPositionData $resolved]} {
if {![info exists _position_data_target] ||
$_position_data_target ne $resolved} {
set _position_data_target $resolved
set _position_data_cache {}
catch {set _position_data_cache [GetPositionData $drop_target $_typelist $time]}
}
::tkdnd::generic::SetDroppedData $_position_data_cache
} else {
set _position_data_target {}
::tkdnd::generic::SetDroppedData {}
}
::tkdnd::generic::HandlePosition $drop_target $drag_source \
$_pressedkeys $rootX $rootY $action
Expand All @@ -121,6 +148,8 @@ proc xdnd::HandleXdndPosition { drop_target rootX rootY time
# Command xdnd::HandleXdndLeave
# ----------------------------------------------------------------------------
proc xdnd::HandleXdndLeave { } {
variable _position_data_target; set _position_data_target {}
variable _position_data_cache; set _position_data_cache {}
#DBG debug "xdnd::HandleXdndLeave"
::tkdnd::generic::HandleLeave
};# xdnd::HandleXdndLeave
Expand Down
Binary file not shown.
8 changes: 4 additions & 4 deletions tkinterdnd2/tkdnd/osx-arm64-tcl9/pkgIndex.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ namespace eval ::tkdnd {

}; # namespace ::tkdnd

package ifneeded tkdnd 2.10.1 \
package ifneeded tkdnd 2.10.2 \
"tkdnd::source \{$dir/tkdnd.tcl\} ; \
tkdnd::initialise \{$dir\} libtcl9tkdnd2.10.1.dylib tkdnd"
tkdnd::initialise \{$dir\} libtcl9tkdnd2.10.2.dylib tkdnd"

package ifneeded tkdnd::utils 2.10.1 \
package ifneeded tkdnd::utils 2.10.2 \
"tkdnd::source \{$dir/tkdnd_utils.tcl\} ; \
package provide tkdnd::utils 2.10.1"
package provide tkdnd::utils 2.10.2"
Loading
Loading