From a7b1f61d797de4a4cb0db977d6fbf1d263d38a32 Mon Sep 17 00:00:00 2001 From: spanne Date: Thu, 30 Jun 2005 14:35:29 +0000 Subject: [PATCH] When a window is iconified, only an UnmapNotify is sent, not a VisibilityNotify, so we have to handle the window status callback in the former case, too. This fixes bug #763442 (Call the visibility callback when minimizing a window). git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@649 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/ChangeLog | 5 +++++ freeglut/freeglut/src/freeglut_main.c | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/freeglut/freeglut/ChangeLog b/freeglut/freeglut/ChangeLog index 937980c..847af4b 100644 --- a/freeglut/freeglut/ChangeLog +++ b/freeglut/freeglut/ChangeLog @@ -1064,3 +1064,8 @@ to crash if it called the code with a negative number of levels event tracing, but in the future we could add more. (275) Cleaned up CreateNotify/ConfigureNotify handling. + +(276) When a window is iconified, only an UnmapNotify is sent, not a +VisibilityNotify, so we have to handle the window status callback in the +former case, too. This fixes bug #763442 (Call the visibility callback when +minimizing a window). diff --git a/freeglut/freeglut/src/freeglut_main.c b/freeglut/freeglut/src/freeglut_main.c index febd4bc..2f95b63 100644 --- a/freeglut/freeglut/src/freeglut_main.c +++ b/freeglut/freeglut/src/freeglut_main.c @@ -1080,11 +1080,13 @@ void FGAPIENTRY glutMainLoopEvent( void ) break; case MapNotify: + break; + case UnmapNotify: - /* - * If we never do anything with this, can we just not ask to - * get these messages? - */ + /* We get this when iconifying a window. */ + GETWINDOW( xunmap ); + INVOKE_WCB( *window, WindowStatus, ( GLUT_HIDDEN ) ); + window->State.Visible = GL_FALSE; break; case MappingNotify: @@ -1109,7 +1111,9 @@ void FGAPIENTRY glutMainLoopEvent( void ) * Sending this event, the X server can notify us that the window * has just acquired one of the three possible visibility states: * VisibilityUnobscured, VisibilityPartiallyObscured or - * VisibilityFullyObscured + * VisibilityFullyObscured. Note that we DO NOT receive a + * VisibilityNotify event when iconifying a window, we only get an + * UnmapNotify then. */ switch( event.xvisibility.state ) {