diff options
author | marc_culler <marc.culler@gmail.com> | 2020-09-02 16:09:53 (GMT) |
---|---|---|
committer | marc_culler <marc.culler@gmail.com> | 2020-09-02 16:09:53 (GMT) |
commit | 1f00cd502ff3b3aef1eb1fac67d20e69fa4e4bad (patch) | |
tree | f03c4dea2cfc003327498536d2fe3d6526c5436a /macosx | |
parent | 8952ee7ee1dc5bbc401ee01f356e3b8ff4a170a3 (diff) | |
download | tk-1f00cd502ff3b3aef1eb1fac67d20e69fa4e4bad.zip tk-1f00cd502ff3b3aef1eb1fac67d20e69fa4e4bad.tar.gz tk-1f00cd502ff3b3aef1eb1fac67d20e69fa4e4bad.tar.bz2 |
Better fix for [d72abe6b54] using NSEvents.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXMouseEvent.c | 9 | ||||
-rw-r--r-- | macosx/tkMacOSXPrivate.h | 7 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 1 |
3 files changed, 14 insertions, 3 deletions
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index f2d7e32..be08a29 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -69,8 +69,13 @@ enum { case NSRightMouseDragged: case NSOtherMouseDragged: button = [theEvent buttonNumber] + Button1; + break; case NSMouseEntered: + [(TKWindow *)eventWindow setMouseInResizeArea:YES]; + break; case NSMouseExited: + [(TKWindow *)eventWindow setMouseInResizeArea:NO]; + break; case NSCursorUpdate: case NSLeftMouseUp: case NSRightMouseUp: @@ -100,12 +105,10 @@ enum { */ if (eventType == NSLeftMouseDown && + [(TKWindow *)eventWindow mouseInResizeArea] && ([eventWindow styleMask] & NSResizableWindowMask) && [NSApp macOSVersion] > 100600) { - NSRect frame = [eventWindow frame]; - if (local.x < 3 || local.x > frame.size.width - 3 || local.y < 3) { return theEvent; - } } global = [eventWindow tkConvertPointToScreen: local]; tkwin = TkMacOSXGetCapture(); diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 5ac834c..ef753e5 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -436,6 +436,13 @@ VISIBILITY_HIDDEN VISIBILITY_HIDDEN @interface TKWindow : NSWindow +{ +#ifdef __i386__ + /* The Objective C runtime used on i386 requires this. */ + Bool _mouseInResizeArea; +#endif +} +@property Bool mouseInResizeArea; @end @interface TKWindow(TKWm) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 453f277..12ce7b2 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -363,6 +363,7 @@ static void RemoveTransient(TkWindow *winPtr); #pragma mark TKWindow(TKWm) @implementation TKWindow: NSWindow +@synthesize mouseInResizeArea = _mouseInResizeArea; @end @implementation TKWindow(TKWm) |