From e90ace63bdfe5268af6b92fc65fae547f473635a Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 10 Sep 2010 00:30:48 +0200 Subject: [PATCH] Fixed one multi-window bug, clarified missing window struct messages. --- src/x11/x11_window.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/x11/x11_window.c b/src/x11/x11_window.c index 1b6b5ee4..11451ba4 100644 --- a/src/x11/x11_window.c +++ b/src/x11/x11_window.c @@ -1063,7 +1063,7 @@ static void processSingleEvent(void) window = findWindow(event.xkey.window); if (window == NULL) { - fprintf(stderr, "Cannot find GLFW window structure for event\n"); + fprintf(stderr, "Cannot find GLFW window structure for KeyPress event\n"); return; } @@ -1082,7 +1082,7 @@ static void processSingleEvent(void) window = findWindow(event.xkey.window); if (window == NULL) { - fprintf(stderr, "Cannot find GLFW window structure for event\n"); + fprintf(stderr, "Cannot find GLFW window structure for KeyRelease event\n"); return; } @@ -1124,7 +1124,7 @@ static void processSingleEvent(void) window = findWindow(event.xbutton.window); if (window == NULL) { - fprintf(stderr, "Cannot find GLFW window structure for event\n"); + fprintf(stderr, "Cannot find GLFW window structure for ButtonPress event\n"); return; } @@ -1158,7 +1158,7 @@ static void processSingleEvent(void) window = findWindow(event.xbutton.window); if (window == NULL) { - fprintf(stderr, "Cannot find GLFW window structure for event\n"); + fprintf(stderr, "Cannot find GLFW window structure for ButtonRelease event\n"); return; } @@ -1189,7 +1189,7 @@ static void processSingleEvent(void) window = findWindow(event.xmotion.window); if (window == NULL) { - fprintf(stderr, "Cannot find GLFW window structure for event\n"); + fprintf(stderr, "Cannot find GLFW window structure for MotionNotify event\n"); return; } @@ -1234,7 +1234,7 @@ static void processSingleEvent(void) window = findWindow(event.xconfigure.window); if (window == NULL) { - fprintf(stderr, "Cannot find GLFW window structure for event\n"); + fprintf(stderr, "Cannot find GLFW window structure for ConfigureNotify event\n"); return; } @@ -1261,7 +1261,7 @@ static void processSingleEvent(void) window = findWindow(event.xclient.window); if (window == NULL) { - fprintf(stderr, "Cannot find GLFW window structure for event\n"); + fprintf(stderr, "Cannot find GLFW window structure for ClientMessage event\n"); return; } @@ -1295,7 +1295,7 @@ static void processSingleEvent(void) window = findWindow(event.xmap.window); if (window == NULL) { - fprintf(stderr, "Cannot find GLFW window structure for event\n"); + fprintf(stderr, "Cannot find GLFW window structure for MapNotify event\n"); return; } @@ -1309,7 +1309,7 @@ static void processSingleEvent(void) window = findWindow(event.xmap.window); if (window == NULL) { - fprintf(stderr, "Cannot find GLFW window structure for event\n"); + fprintf(stderr, "Cannot find GLFW window structure for UnmapNotify event\n"); return; } @@ -1323,7 +1323,7 @@ static void processSingleEvent(void) window = findWindow(event.xfocus.window); if (window == NULL) { - fprintf(stderr, "Cannot find GLFW window structure for event\n"); + fprintf(stderr, "Cannot find GLFW window structure for FocusIn event\n"); return; } @@ -1341,7 +1341,7 @@ static void processSingleEvent(void) window = findWindow(event.xfocus.window); if (window == NULL) { - fprintf(stderr, "Cannot find GLFW window structure for event\n"); + fprintf(stderr, "Cannot find GLFW window structure for FocusOut event\n"); return; } @@ -1360,7 +1360,7 @@ static void processSingleEvent(void) window = findWindow(event.xexpose.window); if (window == NULL) { - fprintf(stderr, "Cannot find GLFW window structure for event\n"); + fprintf(stderr, "Cannot find GLFW window structure for Expose event\n"); return; } @@ -1800,7 +1800,7 @@ void _glfwPlatformPollEvents(void) } } - for (window = _glfwLibrary.windowListHead; window; window = window->next) + for (window = _glfwLibrary.windowListHead; window; ) { if (window->closed && window->windowCloseCallback) window->closed = window->windowCloseCallback(window); @@ -1811,6 +1811,8 @@ void _glfwPlatformPollEvents(void) glfwCloseWindow(window); window = next; } + else + window = window->next; } }