From 1be6f17c668bd48d7d25e60b6606b5693e30c956 Mon Sep 17 00:00:00 2001 From: Hanmac Date: Wed, 1 Feb 2012 00:10:17 +0100 Subject: [PATCH] add _NET_WM_NAME to the hasEWMGH check --- src/x11_platform.h | 1 + src/x11_window.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/x11_platform.h b/src/x11_platform.h index 46f09f1a..3aef3cbf 100644 --- a/src/x11_platform.h +++ b/src/x11_platform.h @@ -141,6 +141,7 @@ typedef struct _GLFWwindowX11 Colormap colormap; // Window colormap Window handle; // Window handle Atom wmDeleteWindow; // WM_DELETE_WINDOW atom + Atom wmName; // _NET_WM_NAME atom Atom wmPing; // _NET_WM_PING atom Atom wmState; // _NET_WM_STATE atom Atom wmStateFullscreen; // _NET_WM_STATE_FULLSCREEN atom diff --git a/src/x11_window.c b/src/x11_window.c index dd387e06..5ab1428c 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -195,6 +195,9 @@ static GLboolean hasEWMH(_GLFWwindow* window) window->X11.wmStateFullscreen = getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE_FULLSCREEN"); + window->X11.wmName = + getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_NAME"); + window->X11.wmPing = getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_PING"); @@ -1513,11 +1516,14 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) XStoreName(_glfwLibrary.X11.display, window->X11.handle, title); XSetIconName(_glfwLibrary.X11.display, window->X11.handle, title); - XChangeProperty(_glfwLibrary.X11.display, window->X11.handle, - XInternAtom(_glfwLibrary.X11.display, "_NET_WM_NAME", False), + if(window->X11.wmName != None) + { + XChangeProperty(_glfwLibrary.X11.display, window->X11.handle, + window->X11.wmName, XInternAtom(_glfwLibrary.X11.display, "UTF8_STRING", False), 8, PropModeReplace, (unsigned char *) title, strlen(title)); + } }