diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | Changelog | 10 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | library/tkdnd_macosx.tcl | 8 | ||||
-rw-r--r-- | macosx/macdnd.m | 35 |
5 files changed, 35 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 47cf2e7..c96fdc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ PROJECT ( tkdnd ) ## Package version information: SET ( PKG_NAME ${PROJECT_NAME} ) SET ( PKG_MAJOR_VERSION 2 ) -SET ( PKG_MINOR_VERSION 2 ) +SET ( PKG_MINOR_VERSION 3 ) SET ( PKG_BUILD_VERSION 0 ) ## Author: SET ( PKG_VENDOR "Georgios Petasis" ) @@ -1,3 +1,13 @@ +2011-01-14 Petasis George <petasis@iit.demokritos.gr> + * /library/tkdnd_macosx.tcl: Fixed a bug reported by Kevin Walzer: + macdnd::_GetDroppedData and xdnd::_GetDroppedData were missing the + "time" argument, added in the XDND section for TIP 370 (if it gets + accepted). + + * /macosx/macdnd.m: Restored back a workarround by Kevin Walzer, as + TkDND does not work well under all circumstances in OS X 10.6. + (Reported by Kevin Walzer on 23 Dec 2010). + 2010-08-03 Petasis George <petasis@iit.demokritos.gr> TkDND 2.2 released. * library/tkdnd_windows.tcl: diff --git a/configure.in b/configure.in index 664446e..9864177 100644 --- a/configure.in +++ b/configure.in @@ -19,7 +19,7 @@ dnl to configure the system for the local environment. # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- -AC_INIT([tkdnd], [2.2]) +AC_INIT([tkdnd], [2.3]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. diff --git a/library/tkdnd_macosx.tcl b/library/tkdnd_macosx.tcl index c857f18..a610d05 100644 --- a/library/tkdnd_macosx.tcl +++ b/library/tkdnd_macosx.tcl @@ -77,7 +77,7 @@ proc macdnd::_HandleLeave { args } { };# macdnd::_HandleLeave # ---------------------------------------------------------------------------- -# Command macdnd::_HandleXdndDrop +# Command macdnd::_HandleDrop # ---------------------------------------------------------------------------- proc macdnd::_HandleDrop { drop_target data args } { variable _dropped_data @@ -88,12 +88,12 @@ proc macdnd::_HandleDrop { drop_target data args } { # ---------------------------------------------------------------------------- # Command macdnd::_GetDroppedData # ---------------------------------------------------------------------------- -proc macdnd::_GetDroppedData { } { +proc macdnd::_GetDroppedData { time } { variable _dropped_data return $_dropped_data };# macdnd::_GetDroppedData -proc xdnd::_GetDroppedData { } { - return [::tkdnd::macdnd::_GetDroppedData] +proc xdnd::_GetDroppedData { time } { + return [::tkdnd::macdnd::_GetDroppedData $time] };# xdnd::_GetDroppedData # ---------------------------------------------------------------------------- diff --git a/macosx/macdnd.m b/macosx/macdnd.m index ae1aba4..6ac1dc3 100644 --- a/macosx/macdnd.m +++ b/macosx/macdnd.m @@ -19,6 +19,8 @@ #import <tkMacOSXInt.h> #import <Cocoa/Cocoa.h> +#define TKDND_OSX_KEVIN_WORKARROUND + #define TkDND_Tag 1234 #define TkDND_TkWin(x) \ @@ -113,14 +115,23 @@ DNDView* TkDND_GetDNDSubview(NSView *view, Tk_Window tkwin) { [view addSubview:dnd_view positioned:NSWindowBelow relativeTo:nil]; } [view setAutoresizesSubviews:true]; - // Rect bnds; - // TkMacOSXWinBounds((TkWindow*)tkwin, &bnds); - // frame = NSMakeRect(bnds.left, bnds.top, 100000, 100000); - // frame.origin.y = 0; - // if (!NSEqualRects(frame, [dnd_view frame])) { - // [dnd_view setFrame:frame]; - // } + /* + * Bug fix by Kevin Walzer: On 23 Dec 2010, Kevin reported that he has + * found cases where the code below is needed, in order for DnD to work + * correctly under Snow Leopard 10.6. So, I am restoring it... + */ +#ifdef TKDND_OSX_KEVIN_WORKARROUND + /* Hack to make sure subview is set to take up entire geometry of window. */ + TkMacOSXWinBounds((TkWindow*)tkwin, &bounds); + frame = NSMakeRect(bounds.left, bounds.top, 100000, 100000); + frame.origin.y = 0; + if (!NSEqualRects(frame, [dnd_view frame])) { + [dnd_view setFrame:frame]; + } +#endif /* TKDND_OSX_KEVIN_WORKARROUND */ } + +#ifndef TKDND_OSX_KEVIN_WORKARROUND if (dnd_view == nil) return dnd_view; /* Ensure that we have the correct geometry... */ @@ -133,16 +144,8 @@ DNDView* TkDND_GetDNDSubview(NSView *view, Tk_Window tkwin) { if (!NSEqualRects(bounds, [dnd_view bounds])) { [dnd_view setBounds:bounds]; } +#endif /* TKDND_OSX_KEVIN_WORKARROUND */ return dnd_view; -#if 0 - /* Hack to make sure subview is set to take up entire geometry of window... */ - frame = NSMakeRect(bounds.left, bounds.top, 100000, 100000); - frame.origin.y = 0; - if (!NSEqualRects(frame, [dnd_view frame])) { - [dnd_view setFrame:frame]; - } - return dnd_view; -#endif }; /* TkDND_GetDNDSubview */ /* Set flags for local DND operations, i.e. dragging within a single |