summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2018-11-22 19:13:29 (GMT)
committerKevin Walzer <kw@codebykevin.com>2018-11-22 19:13:29 (GMT)
commit74567cf0e43fecf2f994fb06f16c6866c93f27d3 (patch)
tree0b8d7988fbb92f792e0539d817ffc18f3e7ea0d5 /macosx
parentbdc4876ca53a1aa429f37abf5beafd3b1c804266 (diff)
downloadtk-74567cf0e43fecf2f994fb06f16c6866c93f27d3.zip
tk-74567cf0e43fecf2f994fb06f16c6866c93f27d3.tar.gz
tk-74567cf0e43fecf2f994fb06f16c6866c93f27d3.tar.bz2
Fix coordinates when window exits full screen
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXWindowEvent.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index 2e5be8f..44702e6 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -156,6 +156,26 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
}
}
+- (void) windowExitedFullScreen: (NSNotification *) notification
+{
+#ifdef TK_MAC_DEBUG_NOTIFICATIONS
+ TKLog(@"-[%@(%p) %s] %@", [self class], self, _cmd, notification);
+#endif
+ NSWindow *w = [notification object];
+ TkWindow *winPtr = TkMacOSXGetTkWindow(w);
+ MacDrawable *macWin = winPtr->privatePtr;
+
+ /*
+ * We must apply the current window attributes when the window becomes a
+ * FullScreen or a split screen window. Otherwise the mouse cursor will be
+ * offset by the title bar height. The notification is sent in both cases.
+ */
+
+ if (winPtr) {
+ TkMacOSXApplyWindowAttributes(macWin->winPtr, w);
+ }
+}
+
- (void) windowCollapsed: (NSNotification *) notification
{
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
@@ -249,6 +269,7 @@ extern NSString *NSWindowDidOrderOffScreenNotification;
observe(NSWindowDidDeminiaturizeNotification, windowExpanded:);
observe(NSWindowDidMiniaturizeNotification, windowCollapsed:);
observe(NSWindowDidEnterFullScreenNotification, windowEnteredFullScreen:);
+ observe(NSWindowDidExitFullScreenNotification, windowExitedFullScreen:);
#ifdef TK_MAC_DEBUG_NOTIFICATIONS
observe(NSWindowWillMoveNotification, windowDragStart:);
observe(NSWindowWillStartLiveResizeNotification, windowLiveResize:);