Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 5678
Status: resolved
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: slaven [...] rezic.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 804.025_beta16
Fixed in: (no value)



Subject: More Drag/Drop Problems [with PATCH]
This problem was posted to the ptk mailing list by Ala Qumsieh. The core of the problem is that for stacked widgets which are dropsites always the first widget get the drops, regardless of the stacking order. Changing Tk::DragSite::Rect to use Tk::Widget::containing seems to work better. Regards, Slaven
# # # To apply this patch: # STEP 1: Chdir to the source directory. # STEP 2: Run the 'applypatch' program with this patch file as input. # # If you do not have 'applypatch', it is part of the 'makepatch' package # that you can fetch from the Comprehensive Perl Archive Network: # http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz # In the above URL, 'x' should be 2 or higher. # # To apply this patch without the use of 'applypatch': # STEP 1: Chdir to the source directory. # STEP 2: Run the 'patch' program with this file as input. # #### End of Preamble #### #### Patch data follows #### diff -up '/usr/local/dist/cpan/build/Tk-804.025_beta14/DragDrop/DragDrop/Rect.pm' 'DragDrop/DragDrop/Rect.pm' Index: ./DragDrop/DragDrop/Rect.pm --- ./DragDrop/DragDrop/Rect.pm Sun Dec 14 20:44:50 2003 +++ ./DragDrop/DragDrop/Rect.pm Mon Mar 15 20:09:16 2004 @@ -9,14 +9,16 @@ $VERSION = sprintf '4.%03d', q$Revision: sub Over { my ($site,$X,$Y) = @_; - my $x = $site->X; - my $y = $site->Y; - my $w = $site->width; - my $h = $site->height; - - my $val = ($X >= $x && $X < ($x + $w) && $Y >= $y && $Y < ($y + $h)); - # print "Over ",$site->Show," $X,$Y => $val\n"; - return $val; + my $Over; + $Over = sub + { + my $w = shift; + return 1 if $w->containing($X,$Y) eq $w; + my $parent = $w->parent; + return if !$parent; + return $Over->($parent); + }; + return $Over->($site->{widget}); } sub FindSite #### End of Patch data #### #### ApplyPatch data follows #### # Data version : 1.0 # Date generated : Mon Mar 15 20:09:18 2004 # Generated by : makepatch 2.00_07* # Recurse directories : Yes # Excluded files : (\A|/).*\~\Z # (\A|/).*\.a\Z # (\A|/).*\.bak\Z # (\A|/).*\.BAK\Z # (\A|/).*\.elc\Z # (\A|/).*\.exe\Z # (\A|/).*\.gz\Z # (\A|/).*\.ln\Z # (\A|/).*\.o\Z # (\A|/).*\.obj\Z # (\A|/).*\.olb\Z # (\A|/).*\.old\Z # (\A|/).*\.orig\Z # (\A|/).*\.rej\Z # (\A|/).*\.so\Z # (\A|/).*\.Z\Z # (\A|/)\.del\-.*\Z # (\A|/)\.make\.state\Z # (\A|/)\.nse_depinfo\Z # (\A|/)core\Z # (\A|/)tags\Z # (\A|/)TAGS\Z # v 'pTk/patchlevel.h' 934 1079376698 33060 # p 'DragDrop/DragDrop/Rect.pm' 1481 1079377756 0100444 #### End of ApplyPatch data #### #### End of Patch kit [created: Mon Mar 15 20:09:18 2004] #### #### Patch checksum: 64 2125 1691 #### #### Checksum: 82 2748 53163 ####
Patch applied
Subject: Re: [cpan #5678] More Drag/Drop Problems [with PATCH]
To: bug-Tk [...] rt.cpan.org
Date: Tue, 16 Mar 2004 19:33:50 +0000
From: Nick Ing-Simmons <nick [...] ing-simmons.net>
RT-Send-Cc:
Slaven_Rezic via RT <bug-Tk@rt.cpan.org> writes: Show quoted text
>This message about Tk was sent to you by SREZIC <SREZIC@cpan.org> via >rt.cpan.org > >Full context and any attached attachments can be found at: <URL: >https://rt.cpan.org/Ticket/Display.html?id=5678 > > >This problem was posted to the ptk mailing list by Ala Qumsieh. The core of >the problem is that for stacked widgets which are dropsites always the first >widget get the drops, regardless of the stacking order. Changing >Tk::DragSite::Rect to use Tk::Widget::containing seems to work better.
Not for me it doesn't - it is MUCH worse. Without the patch I can drop from SuSE's file manager thing onto perl -Mblib DragDrop/site_test (the XDND site). With the patch odd things happen sometimes it will do drop most of time it won't. Is there a testcase which shows the problem (to save me hunting in my mailbox.) The code in XDNDSite is clearly wrong for case of overlapping sites, so unless something else divides sites up into rectangles that don't overlap (which may be case as Sun's scheme needed that) it needs work. Show quoted text
> >Regards, Slaven