From a69974403e5778fd77c5d2d66efda166a89fbdad Mon Sep 17 00:00:00 2001 From: Marcel Metz Date: Mon, 30 Jan 2012 16:21:21 +0100 Subject: [PATCH] Added x11 support for monitor PnP detection. --- src/x11_window.c | 19 ++++++++++--------- tests/events.c | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/x11_window.c b/src/x11_window.c index 641b3c84..04f55be5 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -1366,6 +1366,7 @@ static void processSingleEvent(void) { // Show XRandR that we really care XRRUpdateConfiguration(&event); + _glfwRefreshMonitors(); break; } } @@ -1423,18 +1424,18 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window, if (!createWindow(window, wndconfig)) return GL_FALSE; - if (wndconfig->mode == GLFW_FULLSCREEN) - { #if defined(_GLFW_HAS_XRANDR) - // Request screen change notifications - if (_glfwLibrary.X11.RandR.available) - { - XRRSelectInput(_glfwLibrary.X11.display, - window->X11.handle, - RRScreenChangeNotifyMask); - } + // Request screen change notifications + if (_glfwLibrary.X11.RandR.available) + { + XRRSelectInput(_glfwLibrary.X11.display, + window->X11.handle, + RRScreenChangeNotifyMask); + } #endif /*_GLFW_HAS_XRANDR*/ + if (wndconfig->mode == GLFW_FULLSCREEN) + { enterFullscreenMode(window); } diff --git a/tests/events.c b/tests/events.c index 1a1280a3..1d4bf64e 100644 --- a/tests/events.c +++ b/tests/events.c @@ -345,7 +345,7 @@ static void char_callback(GLFWwindow window, int character) void monitor_callback(GLFWmonitor monitor, int event) { - printf("%08x at %0.3f: Monitor %s %s", + printf("%08x at %0.3f: Monitor %s %s\n", counter++, glfwGetTime(), glfwGetMonitorString(monitor, GLFW_MONITOR_NAME),