mirror of https://github.com/buggins/dlangui.git
Add class hint for x11 window
This commit is contained in:
parent
2c6da55e63
commit
c3aa8637a4
|
@ -339,6 +339,14 @@ class X11Window : DWindow {
|
||||||
XSetWMProtocols(x11display, _win, &atom_WM_DELETE_WINDOW, 1);
|
XSetWMProtocols(x11display, _win, &atom_WM_DELETE_WINDOW, 1);
|
||||||
_windowState = WindowState.hidden;
|
_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);
|
_children.reserve(20);
|
||||||
_parent = cast(X11Window) parent;
|
_parent = cast(X11Window) parent;
|
||||||
if (_parent)
|
if (_parent)
|
||||||
|
@ -1277,9 +1285,13 @@ private immutable int TIMER_EVENT = 8;
|
||||||
class X11Platform : Platform {
|
class X11Platform : Platform {
|
||||||
|
|
||||||
this() {
|
this() {
|
||||||
|
import std.file : thisExePath;
|
||||||
|
import std.path : baseName;
|
||||||
|
_classname = (baseName(thisExePath()) ~ "\0").dup.ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
private X11Window[XWindow] _windowMap;
|
private X11Window[XWindow] _windowMap;
|
||||||
|
private char* _classname;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create window
|
* create window
|
||||||
|
|
Loading…
Reference in New Issue