From 167b6e69e4461970ee4badf9d1bceb3d6554658e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 26 Jan 2012 13:08:19 +0000 Subject: [PATCH] From J.P. Delport, "when switching from windowed mode to fullscreen (with the 'f' key) in X11, no RESIZE event is generated. This confuses handlers that perform some processing on the RESIZE event, e.g. the InteractiveImageHandler. To reproduce the problem I attach a minimally modified osgviewer that just prints resize events. You can check what's printed in the console when you go fullscreen and windowed a few times. The attached version of GraphicsWindowX11 fixes the problem for me, but I'm not sure this is the right approach. Maybe you can see a fix for the problem clearer. The only place where the RESIZE event is generated in GraphicsWindowX11 is in CheckEvents and it then depends on the ConfigureNotify message. For some reason, either ConfigureNotify is not sent when going fullscreen or the traits already reflect the latest window size." --- src/osgViewer/GraphicsWindowX11.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osgViewer/GraphicsWindowX11.cpp b/src/osgViewer/GraphicsWindowX11.cpp index fe7794802..9d528329f 100644 --- a/src/osgViewer/GraphicsWindowX11.cpp +++ b/src/osgViewer/GraphicsWindowX11.cpp @@ -373,6 +373,11 @@ bool GraphicsWindowX11::checkAndSendEventFullScreenIfNeeded(Display* display, in wsi->getScreenResolution(*_traits, screenWidth, screenHeight); bool isFullScreen = x == 0 && y == 0 && width == (int)screenWidth && height == (int)screenHeight && !windowDecoration; + if (isFullScreen) { + resized(x, y, width, height); + getEventQueue()->windowResize(x, y, width, height, getEventQueue()->getTime()); + } + Atom netWMStateAtom = XInternAtom(display, "_NET_WM_STATE", True); Atom netWMStateFullscreenAtom = XInternAtom(display, "_NET_WM_STATE_FULLSCREEN", True);