summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-12-03 15:21:32 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-12-03 15:21:32 (GMT)
commit0b211c22418acb8c209a71580ce2b262a322bd9b (patch)
tree0acf8fa8963e9c731a213f5f3d050d5f8c014fc7 /macosx
parenta7f42afa4caeab5a05a5eab3b22db3d5c99ebc52 (diff)
downloadtk-0b211c22418acb8c209a71580ce2b262a322bd9b.zip
tk-0b211c22418acb8c209a71580ce2b262a322bd9b.tar.gz
tk-0b211c22418acb8c209a71580ce2b262a322bd9b.tar.bz2
Fix [40af63fa24]: Aqua: passing None to XMapWindow() should be fatal
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXSubwindows.c2
-rw-r--r--macosx/tkMacOSXWm.c24
2 files changed, 14 insertions, 12 deletions
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index c950877..fb71a0c 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -128,7 +128,7 @@ XDestroyWindow(
* Tk_WmMapWindow.
*
* Results:
- * Returns Success or BadWindow.
+ * Always returns Success or BadWindow.
*
* Side effects:
* The subwindow or toplevel may appear on the screen. VisibilityNotify
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 858ac34..93baa2d 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -874,18 +874,20 @@ TkWmUnmapWindow(
TkWindow *winPtr) /* Top-level window that's about to be
* unmapped. */
{
- XEvent event;
-
- event.xany.serial = LastKnownRequestProcessed(winPtr->display);
- event.xany.send_event = False;
- event.xany.display = winPtr->display;
- event.xunmap.type = UnmapNotify;
- event.xunmap.window = winPtr->window;
- event.xunmap.event = winPtr->window;
- event.xunmap.from_configure = false;
winPtr->flags &= ~TK_MAPPED;
- XUnmapWindow(winPtr->display, winPtr->window);
- Tk_HandleEvent(&event);
+ if ((winPtr->window != None)
+ && (XUnmapWindow(winPtr->display, winPtr->window) == Success)) {
+ XEvent event;
+
+ event.xany.serial = LastKnownRequestProcessed(winPtr->display);
+ event.xany.send_event = False;
+ event.xany.display = winPtr->display;
+ event.xunmap.type = UnmapNotify;
+ event.xunmap.window = winPtr->window;
+ event.xunmap.event = winPtr->window;
+ event.xunmap.from_configure = false;
+ Tk_HandleEvent(&event);
+ }
}
/*