summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2005-03-10 07:36:23 (GMT)
committerwolfsuit <wolfsuit>2005-03-10 07:36:23 (GMT)
commit64d087fdcde6b6c0f03c065fb33006319d314766 (patch)
treea8edb32bae8ae5abee2f2d887179527f24c28e72
parent88040acda86230fe9cc4ebfef29321940976db05 (diff)
downloadtk-64d087fdcde6b6c0f03c065fb33006319d314766.zip
tk-64d087fdcde6b6c0f03c065fb33006319d314766.tar.gz
tk-64d087fdcde6b6c0f03c065fb33006319d314766.tar.bz2
Fix for 1160025
-rw-r--r--ChangeLog6
-rw-r--r--macosx/tkMacOSXMouseEvent.c36
2 files changed, 30 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index ba768bd..10549a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-03-10 Jim Ingham <jingham@apple.com>
+
+ * macosx/tkMacOSXMouseEvent.c (TkMacOSXProcessMouseEvent): In
+ the inDrag section, set the GrafPort to the drag window's GrafPort
+ before doing LocalToGlobal. [Bug 1160025]
+
2005-03-09 Jim Ingham <jingham@apple.com>
* macosx/tkMacOSXInit.c (TkpInit): Check to see if the environment
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 168ef73..69a322b 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -334,19 +334,31 @@ TkMacOSXProcessMouseEvent(TkMacOSXEvent *eventPtr, MacEventStatus * statusPtr)
switch (medPtr->windowPart) {
case inDrag:
- DragWindow(medPtr->whichWin, where, NULL);
- where2.h = where2.v = 0;
- LocalToGlobal(&where2);
- if (EqualPt(where, where2)) {
- return false;
+ {
+ CGrafPtr saveWorld;
+ GDHandle saveDevice;
+ GWorldPtr dstPort;
+
+ GetGWorld(&saveWorld, &saveDevice);
+ dstPort = TkMacOSXGetDrawablePort(Tk_WindowId(tkwin));
+ SetGWorld(dstPort, NULL);
+
+ DragWindow(medPtr->whichWin, where, NULL);
+ where2.h = where2.v = 0;
+ LocalToGlobal(&where2);
+ if (EqualPt(where, where2)) {
+ SetGWorld (saveWorld, saveDevice);
+ return false;
+ }
+ TkMacOSXWindowOffset(medPtr->whichWin, &xOffset, &yOffset);
+ where2.h -= xOffset;
+ where2.v -= yOffset;
+ TkGenWMConfigureEvent(tkwin, where2.h, where2.v,
+ -1, -1, TK_LOCATION_CHANGED);
+ SetGWorld(saveWorld, saveDevice);
+ return true;
+ break;
}
- TkMacOSXWindowOffset(medPtr->whichWin, &xOffset, &yOffset);
- where2.h -= xOffset;
- where2.v -= yOffset;
- TkGenWMConfigureEvent(tkwin, where2.h, where2.v,
- -1, -1, TK_LOCATION_CHANGED);
- return true;
- break;
case inContent:
return TkGenerateButtonEvent(where.h, where.v,
window, medPtr->state);