From 06074bc6988295ae427bb5266d4e3e529af5f33d Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 2 Feb 2012 17:20:14 +0100 Subject: [PATCH] Added support for _NET_WM_ICON_NAME. --- src/x11_platform.h | 1 + src/x11_window.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/x11_platform.h b/src/x11_platform.h index 3aef3cbf..e837b2f1 100644 --- a/src/x11_platform.h +++ b/src/x11_platform.h @@ -142,6 +142,7 @@ typedef struct _GLFWwindowX11 Window handle; // Window handle Atom wmDeleteWindow; // WM_DELETE_WINDOW atom Atom wmName; // _NET_WM_NAME atom + Atom wmIconName; // _NET_WM_ICON_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 606512b9..7ad34d05 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -198,6 +198,9 @@ static GLboolean hasEWMH(_GLFWwindow* window) window->X11.wmName = getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_NAME"); + window->X11.wmIconName = + getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_ICON_NAME"); + window->X11.wmPing = getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_PING"); @@ -1512,6 +1515,8 @@ void _glfwPlatformCloseWindow(_GLFWwindow* window) void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) { + Atom type = XInternAtom(_glfwLibrary.X11.display, "UTF8_STRING", False); + #if defined(X_HAVE_UTF8_STRING) Xutf8SetWMProperties(_glfwLibrary.X11.display, window->X11.handle, @@ -1530,12 +1535,19 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) if (window->X11.wmName != None) { - Atom type = XInternAtom(_glfwLibrary.X11.display, "UTF8_STRING", False); XChangeProperty(_glfwLibrary.X11.display, window->X11.handle, window->X11.wmName, type, 8, PropModeReplace, (unsigned char*) title, strlen(title)); } + + if (window->X11.wmIconName != None) + { + XChangeProperty(_glfwLibrary.X11.display, window->X11.handle, + window->X11.wmIconName, type, 8, + PropModeReplace, + (unsigned char*) title, strlen(title)); + } }