From 8194f1e2ae72715efbcc03de34c9a8e5bd8e8de5 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 4 Oct 2013 13:41:19 +0200 Subject: [PATCH] Added hack for setting WM_CLASS. --- README.md | 1 + src/x11_window.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index df7b45b6..eb666b7a 100644 --- a/README.md +++ b/README.md @@ -212,6 +212,7 @@ See the [GLFW documentation](http://www.glfw.org/docs/latest/). been flipped - [Cocoa] Bugfix: The `GLFW_KEY_F13` key was reported as `GLFW_KEY_PRINT_SCREEN` + - [X11] Added setting of the `WM_CLASS` property to the initial window title ## Contact diff --git a/src/x11_window.c b/src/x11_window.c index f0e872e4..f7f172e6 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -268,6 +268,19 @@ static GLboolean createWindow(_GLFWwindow* window, XFree(hints); } + // Set ICCCM WM_CLASS property + // HACK: Until a mechanism for specifying the application name is added, the + // initial window title is used as the window class name + if (strlen(wndconfig->title)) + { + XClassHint* hint = XAllocClassHint(); + hint->res_name = (char*) wndconfig->title; + hint->res_class = (char*) wndconfig->title; + + XSetClassHint(_glfw.x11.display, window->x11.handle, hint); + XFree(hint); + } + if (_glfw.x11.xi.available) { // Select for XInput2 events