summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWm.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r--macosx/tkMacOSXWm.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index ed930fe..33a88d8 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -403,6 +403,9 @@ NSStatusItem *exitFullScreen;
- (void)toggleFullScreen:(id)sender
{
TkWindow *winPtr = TkMacOSXGetTkWindow(self);
+ if (!winPtr) {
+ return;
+ }
Tcl_Interp *interp = Tk_Interp((Tk_Window)winPtr);
if ([NSApp macMinorVersion] > 12) {
if (([self styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask) {
@@ -418,6 +421,9 @@ NSStatusItem *exitFullScreen;
-(void)restoreOldScreen:(id)sender {
TkWindow *winPtr = TkMacOSXGetTkWindow(self);
+ if (!winPtr) {
+ return;
+ }
Tcl_Interp *interp = Tk_Interp((Tk_Window)winPtr);
TkMacOSXMakeFullscreen(winPtr, self, 0, interp);
@@ -431,8 +437,10 @@ NSStatusItem *exitFullScreen;
- (BOOL) canBecomeKeyWindow
{
TkWindow *winPtr = TkMacOSXGetTkWindow(self);
-
- return (winPtr && winPtr->wmInfoPtr && (winPtr->wmInfoPtr->macClass ==
+ if (!winPtr) {
+ return NO;
+ }
+ return (winPtr->wmInfoPtr && (winPtr->wmInfoPtr->macClass ==
kHelpWindowClass || winPtr->wmInfoPtr->attributes &
kWindowNoActivatesAttribute)) ? NO : YES;
}