Merge pull request #486 from FreeSlave/x11_classhint

Add class hint for x11 window
This commit is contained in:
Vadim Lopatin 2017-10-16 11:21:46 +03:00 committed by GitHub
commit 32cb4e03e1
1 changed files with 12 additions and 0 deletions

View File

@ -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)
@ -1275,9 +1283,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