summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authormarc_culler <marc.culler@gmail.com>2021-10-30 02:07:26 (GMT)
committermarc_culler <marc.culler@gmail.com>2021-10-30 02:07:26 (GMT)
commit5f76c797dd0052ef8fded2fe5d64cb7dbcfd1d41 (patch)
tree44972574908af101a02f4e38fff7e4bc03472cc9 /macosx
parent427326e6504bbc34f653977e2dd4d9fc22e3c73c (diff)
parentae9ec0f179b4d64a2fc92134c8d909c628e5a86d (diff)
downloadtk-5f76c797dd0052ef8fded2fe5d64cb7dbcfd1d41.zip
tk-5f76c797dd0052ef8fded2fe5d64cb7dbcfd1d41.tar.gz
tk-5f76c797dd0052ef8fded2fe5d64cb7dbcfd1d41.tar.bz2
Merge 8.6
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXMouseEvent.c16
-rw-r--r--macosx/tkMacOSXWindowEvent.c6
2 files changed, 13 insertions, 9 deletions
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index 43babbc..2fcdeb9 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -181,20 +181,18 @@ enum {
*/
capture = TkMacOSXGetCapture();
- if (capture) {
+ if (eventWindow) {
+ winPtr = TkMacOSXGetTkWindow(eventWindow);
+ } else if (capture) {
winPtr = (TkWindow *) capture;
eventWindow = TkMacOSXGetNSWindowForDrawable(winPtr->window);
if (!eventWindow) {
return theEvent;
}
- } else {
- if (eventWindow) {
- winPtr = TkMacOSXGetTkWindow(eventWindow);
- }
- if (!winPtr) {
- eventWindow = [NSApp mainWindow];
- winPtr = TkMacOSXGetTkWindow(eventWindow);
- }
+ }
+ if (!winPtr) {
+ eventWindow = [NSApp mainWindow];
+ winPtr = TkMacOSXGetTkWindow(eventWindow);
}
if (!winPtr) {
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index 410c4b5..e8de467 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -162,6 +162,9 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
#endif
+ if (![[notification object] respondsToSelector: @selector (tkLayoutChanged)]) {
+ return;
+ }
[(TKWindow *)[notification object] tkLayoutChanged];
}
@@ -170,6 +173,9 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
#endif
+ if (![[notification object] respondsToSelector: @selector (tkLayoutChanged)]) {
+ return;
+ }
[(TKWindow *)[notification object] tkLayoutChanged];
}