From: Miles Bader Date: Mon, 4 Sep 2000 11:55:02 +0000 (+0000) Subject: (XlwMenuSetValues): Only frob the display if the menu is actually displayed. X-Git-Tag: emacs-pretest-21.0.90~1814 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=da353f232d84f8fbce0a34d6087f5e8edb17d798;p=emacs.git (XlwMenuSetValues): Only frob the display if the menu is actually displayed. --- diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c index 1ced18a5eb2..2239fb4b958 100644 --- a/lwlib/xlwmenu.c +++ b/lwlib/xlwmenu.c @@ -1813,15 +1813,17 @@ XlwMenuSetValues (current, request, new) 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;