[x11] Use "application/config/name" for WM_CLASS
This commit is contained in:
parent
8068d0217a
commit
f402253939
3 changed files with 13 additions and 1 deletions
|
@ -480,6 +480,7 @@ public:
|
||||||
enum EngineContext {
|
enum EngineContext {
|
||||||
CONTEXT_EDITOR,
|
CONTEXT_EDITOR,
|
||||||
CONTEXT_PROJECTMAN,
|
CONTEXT_PROJECTMAN,
|
||||||
|
CONTEXT_ENGINE,
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual void set_context(int p_context);
|
virtual void set_context(int p_context);
|
||||||
|
|
|
@ -1692,6 +1692,9 @@ bool Main::start() {
|
||||||
OS::get_singleton()->set_context(OS::CONTEXT_EDITOR);
|
OS::get_singleton()->set_context(OS::CONTEXT_EDITOR);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (!editor) {
|
||||||
|
OS::get_singleton()->set_context(OS::CONTEXT_ENGINE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!project_manager && !editor) { // game
|
if (!project_manager && !editor) { // game
|
||||||
|
|
|
@ -2849,11 +2849,19 @@ void OS_X11::set_context(int p_context) {
|
||||||
XClassHint *classHint = XAllocClassHint();
|
XClassHint *classHint = XAllocClassHint();
|
||||||
if (classHint) {
|
if (classHint) {
|
||||||
|
|
||||||
|
char *wm_class = (char *)"Godot";
|
||||||
if (p_context == CONTEXT_EDITOR)
|
if (p_context == CONTEXT_EDITOR)
|
||||||
classHint->res_name = (char *)"Godot_Editor";
|
classHint->res_name = (char *)"Godot_Editor";
|
||||||
if (p_context == CONTEXT_PROJECTMAN)
|
if (p_context == CONTEXT_PROJECTMAN)
|
||||||
classHint->res_name = (char *)"Godot_ProjectList";
|
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);
|
XSetClassHint(x11_display, x11_window, classHint);
|
||||||
XFree(classHint);
|
XFree(classHint);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue