summaryrefslogtreecommitdiffstats
path: root/win
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 /win
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 'win')
-rw-r--r--win/tkWinWindow.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/win/tkWinWindow.c b/win/tkWinWindow.c
index b85d59d..da92ee8 100644
--- a/win/tkWinWindow.c
+++ b/win/tkWinWindow.c
@@ -340,7 +340,7 @@ XDestroyWindow(
* Cause the given window to become visible.
*
* Results:
- * None
+ * Always returns Success or BadWindow.
*
* Side effects:
* Causes the window state to change, and generates a MapNotify event.
@@ -355,8 +355,12 @@ XMapWindow(
{
XEvent event;
TkWindow *parentPtr;
- TkWindow *winPtr = TkWinGetWinPtr(w);
+ TkWindow *winPtr;
+ if (!w) {
+ return BadWindow;
+ }
+ winPtr = TkWinGetWinPtr(w);
LastKnownRequestProcessed(display)++;
ShowWindow(Tk_GetHWND(w), SW_SHOWNORMAL);
@@ -449,7 +453,7 @@ NotifyVisibility(
* Cause the given window to become invisible.
*
* Results:
- * None
+ * Always returns Success or BadWindow.
*
* Side effects:
* Causes the window state to change, and generates an UnmapNotify event.
@@ -463,8 +467,12 @@ XUnmapWindow(
Window w)
{
XEvent event;
- TkWindow *winPtr = TkWinGetWinPtr(w);
+ TkWindow *winPtr;
+ if (!w) {
+ return BadWindow;
+ }
+ winPtr = TkWinGetWinPtr(w);
LastKnownRequestProcessed(display)++;
/*