diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-12-07 22:35:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-07 22:35:17 +0100 |
commit | dc2fadc14d1c83fc43683e90a215182c9db1b781 (patch) | |
tree | 47079b34b465a025cd5b0fe74a5f1ab77a3f1707 | |
parent | 49ac23e29f2df7f4bc50fba85e460cecda82cc8f (diff) | |
parent | f40225393900885a16591cdb68158ca50e3612fa (diff) |
Merge pull request #22733 from guilhermefelipecgs/fix_wm_class
[x11] Use "application/config/name" for WM_CLASS
-rw-r--r-- | core/os/os.h | 1 | ||||
-rw-r--r-- | main/main.cpp | 3 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 10 |
3 files changed, 13 insertions, 1 deletions
diff --git a/core/os/os.h b/core/os/os.h index 7786ffb26e..53a5ebde01 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -480,6 +480,7 @@ public: enum EngineContext { CONTEXT_EDITOR, CONTEXT_PROJECTMAN, + CONTEXT_ENGINE, }; virtual void set_context(int p_context); diff --git a/main/main.cpp b/main/main.cpp index 6a786e9cb5..7383294167 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1705,6 +1705,9 @@ bool Main::start() { OS::get_singleton()->set_context(OS::CONTEXT_EDITOR); } #endif + if (!editor) { + OS::get_singleton()->set_context(OS::CONTEXT_ENGINE); + } } if (!project_manager && !editor) { // game diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 04854e93b6..0c02e47b5e 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -2853,11 +2853,19 @@ void OS_X11::set_context(int p_context) { XClassHint *classHint = XAllocClassHint(); if (classHint) { + char *wm_class = (char *)"Godot"; if (p_context == CONTEXT_EDITOR) classHint->res_name = (char *)"Godot_Editor"; if (p_context == CONTEXT_PROJECTMAN) classHint->res_name = (char *)"Godot_ProjectList"; - classHint->res_class = (char *)"Godot"; + + if (p_context == CONTEXT_ENGINE) { + classHint->res_name = (char *)"Godot_Engine"; + wm_class = (char *)((String)GLOBAL_GET("application/config/name")).utf8().ptrw(); + } + + classHint->res_class = wm_class; + XSetClassHint(x11_display, x11_window, classHint); XFree(classHint); } |