changeset 31364:8bafcf2cfd57

(XlwMenuSetValues): Only frob the display if the menu is actually displayed.
author Miles Bader <miles@gnu.org>
date Mon, 04 Sep 2000 11:55:02 +0000
parents 6865e0a3ad1d
children 048a65296215
files lwlib/xlwmenu.c
diffstat 1 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lwlib/xlwmenu.c	Mon Sep 04 09:41:48 2000 +0000
+++ b/lwlib/xlwmenu.c	Mon Sep 04 11:55:02 2000 +0000
@@ -1813,15 +1813,17 @@
 
       redisplay = True;
       
-      for (i = 0; i < oldmw->menu.windows_length; i++)
-	{
-	  XSetWindowBackground (XtDisplay (oldmw),
-				oldmw->menu.windows [i].window,
-				newmw->core.background_pixel);
-	  /* clear windows and generate expose events */
-	  XClearArea (XtDisplay (oldmw), oldmw->menu.windows[i].window,
-		      0, 0, 0, 0, True);
-	}
+      if (XtIsRealized (oldmw))
+	/* If the menu is currently displayed, change the display.  */
+	for (i = 0; i < oldmw->menu.windows_length; i++)
+	  {
+	    XSetWindowBackground (XtDisplay (oldmw),
+				  oldmw->menu.windows [i].window,
+				  newmw->core.background_pixel);
+	    /* clear windows and generate expose events */
+	    XClearArea (XtDisplay (oldmw), oldmw->menu.windows[i].window,
+			0, 0, 0, 0, True);
+	  }
     }
 
   return redisplay;