From c3aa8637a42cf17c234af4f61437fb92f96ab6fd Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Thu, 12 Oct 2017 23:15:21 +0300 Subject: [PATCH] Add class hint for x11 window --- src/dlangui/platforms/x11/x11app.d | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/dlangui/platforms/x11/x11app.d b/src/dlangui/platforms/x11/x11app.d index 320af040..8ab66101 100644 --- a/src/dlangui/platforms/x11/x11app.d +++ b/src/dlangui/platforms/x11/x11app.d @@ -339,6 +339,14 @@ class X11Window : DWindow { XSetWMProtocols(x11display, _win, &atom_WM_DELETE_WINDOW, 1); _windowState = WindowState.hidden; + auto classHint = XAllocClassHint(); + if (classHint) { + classHint.res_name = platform._classname; + classHint.res_class = platform._classname; + XSetClassHint(x11display, _win, classHint); + XFree(classHint); + } + _children.reserve(20); _parent = cast(X11Window) parent; if (_parent) @@ -1277,9 +1285,13 @@ private immutable int TIMER_EVENT = 8; class X11Platform : Platform { this() { + import std.file : thisExePath; + import std.path : baseName; + _classname = (baseName(thisExePath()) ~ "\0").dup.ptr; } private X11Window[XWindow] _windowMap; + private char* _classname; /** * create window