diff options
author | Richard Adenling <dreeze@gmail.com> | 2017-08-18 20:39:51 +0200 |
---|---|---|
committer | Richard Adenling <dreeze@gmail.com> | 2017-08-19 00:16:46 +0200 |
commit | 398e0930dcec5a870fa2ee7a1f81a8c8b3158c33 (patch) | |
tree | e10662a8d63b78f2e1982990014aa9ad74104817 /platform/x11/context_gl_x11.cpp | |
parent | cbcf40bd31649d18b24952aec0051cdfbfa78606 (diff) | |
download | redot-engine-398e0930dcec5a870fa2ee7a1f81a8c8b3158c33.tar.gz |
Set the X11 class hint before mapping the window
Setting the class hint before mapping the window will allow some
window managers to determine if a window should be treated specially.
This is also in accordance with the ICCCM spec which says that
WM_CLASS should only be changed when a window is in a
withdrawn (unmapped) state.
Fixes #10429
Diffstat (limited to 'platform/x11/context_gl_x11.cpp')
-rw-r--r-- | platform/x11/context_gl_x11.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp index ddf17481b1..f055d730db 100644 --- a/platform/x11/context_gl_x11.cpp +++ b/platform/x11/context_gl_x11.cpp @@ -83,6 +83,19 @@ static int ctxErrorHandler(Display *dpy, XErrorEvent *ev) { return 0; } +static void set_class_hint(Display *p_display, Window p_window) { + XClassHint *classHint; + + /* set the name and class hints for the window manager to use */ + classHint = XAllocClassHint(); + if (classHint) { + classHint->res_name = (char *)"Godot_Engine"; + classHint->res_class = (char *)"Godot"; + } + XSetClassHint(p_display, p_window, classHint); + XFree(classHint); +} + Error ContextGL_X11::initialize() { GLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribsARB = NULL; @@ -127,6 +140,7 @@ Error ContextGL_X11::initialize() { */ x11_window = XCreateWindow(x11_display, RootWindow(x11_display, vi->screen), 0, 0, OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel | CWColormap | CWEventMask, &swa); ERR_FAIL_COND_V(!x11_window, ERR_UNCONFIGURED); + set_class_hint(x11_display, x11_window); XMapWindow(x11_display, x11_window); //}; |