diff options
author | culler <culler> | 2020-04-26 22:35:01 (GMT) |
---|---|---|
committer | culler <culler> | 2020-04-26 22:35:01 (GMT) |
commit | 3d5553c792d681627037b1c7fb47a5884e9fa55d (patch) | |
tree | b4b9574fccec080bcd4f457ad30ae6234b6f45bf /macosx | |
parent | 022c2fd5dc1cc83cc6606d7e83495af76e8bdbd8 (diff) | |
download | tk-3d5553c792d681627037b1c7fb47a5884e9fa55d.zip tk-3d5553c792d681627037b1c7fb47a5884e9fa55d.tar.gz tk-3d5553c792d681627037b1c7fb47a5884e9fa55d.tar.bz2 |
Revert change to tkMacOSXMouseEvent.c which broke local grabs and add a NULL pointer guard in setupXEvent.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXKeyEvent.c | 3 | ||||
-rw-r--r-- | macosx/tkMacOSXMouseEvent.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c index fe71ea9..fb75fb6 100644 --- a/macosx/tkMacOSXKeyEvent.c +++ b/macosx/tkMacOSXKeyEvent.c @@ -553,6 +553,9 @@ setupXEvent(XEvent *xEvent, Tk_Window tkwin, NSUInteger modifiers) unsigned int state = 0; Display *display = Tk_Display(tkwin); + if (tkwin == NULL) { + return; + } if (modifiers) { state = (modifiers & NSAlphaShiftKeyMask ? LockMask : 0) | (modifiers & NSShiftKeyMask ? ShiftMask : 0) | diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c index d475dbc..dd50d0a 100644 --- a/macosx/tkMacOSXMouseEvent.c +++ b/macosx/tkMacOSXMouseEvent.c @@ -123,6 +123,7 @@ enum { } } local.y = [eventWindow frame].size.height - local.y; + global.y = TkMacOSXZeroScreenHeight() - global.y; } else { /* @@ -142,6 +143,7 @@ enum { } local = [eventWindow tkConvertPointFromScreen: global]; local.y = [eventWindow frame].size.height - local.y; + global.y = TkMacOSXZeroScreenHeight() - global.y; } /* @@ -220,7 +222,6 @@ enum { tkwin = Tk_TopCoordsToWindow(tkwin, local.x, local.y, &win_x, &win_y); local.x = win_x; local.y = win_y; - global.y = TkMacOSXZeroScreenHeight() - global.y; /* * Generate an XEvent for this mouse event. |