From 1767055ead05e00a04e66907fe39923bb1e12ae3 Mon Sep 17 00:00:00 2001 From: "blizzard%redhat.com" Date: Sat, 10 Jul 1999 20:51:18 +0000 Subject: [PATCH] Make sure that when looking for extra ConfigureNotify events that you check to make sure that the event that you get is actually a ConfigureNotify event. StructureNotifyMask includes other things, too. "I can't believe this ever worked." This is not part of the build. --- widget/src/xlib/nsAppShell.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/widget/src/xlib/nsAppShell.cpp b/widget/src/xlib/nsAppShell.cpp index f7bc00d625a..289523631d9 100644 --- a/widget/src/xlib/nsAppShell.cpp +++ b/widget/src/xlib/nsAppShell.cpp @@ -287,6 +287,7 @@ void nsAppShell::DispatchEvent(XEvent *event) { nsWidget *widget; + XEvent config_event; widget = nsWidget::GetWidgetForWindow(event->xany.window); // switch on the type of event switch (event->type) { @@ -296,7 +297,21 @@ nsAppShell::DispatchEvent(XEvent *event) case ConfigureNotify: // we need to make sure that this is the LAST of the // config events. - while (XCheckWindowEvent(mDisplay, event->xany.window, StructureNotifyMask, event) == True); + PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("DispatchEvent: ConfigureNotify event for window 0x%lx %d %d %d %d\n", + event->xconfigure.window, + event->xconfigure.x, event->xconfigure.y, + event->xconfigure.width, event->xconfigure.height)); + while (XCheckWindowEvent(mDisplay, event->xany.window, StructureNotifyMask, &config_event) == True) { + // make sure that we don't get other types of events. StructureNotifyMask + // includes other kinds of events, too. + if (config_event.type == ConfigureNotify) { + *event = config_event; + PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("DispatchEvent: Extra ConfigureNotify event for window 0x%lx %d %d %d %d\n", + event->xconfigure.window, + event->xconfigure.x, event->xconfigure.y, + event->xconfigure.width, event->xconfigure.height)); + } + } HandleConfigureNotifyEvent(event, widget); break; case ButtonPress: