make skiptaskbar test actually skip the taskbar
This commit is contained in:
parent
7d93a21878
commit
58acd2b2dd
1 changed files with 10 additions and 16 deletions
|
@ -23,9 +23,9 @@
|
||||||
|
|
||||||
int main () {
|
int main () {
|
||||||
Display *display;
|
Display *display;
|
||||||
Window parent, child;
|
Window win;
|
||||||
XEvent report;
|
XEvent report;
|
||||||
Atom state, modal;
|
Atom state, skip;
|
||||||
int x=10,y=10,h=400,w=400;
|
int x=10,y=10,h=400,w=400;
|
||||||
|
|
||||||
display = XOpenDisplay(NULL);
|
display = XOpenDisplay(NULL);
|
||||||
|
@ -36,24 +36,18 @@ int main () {
|
||||||
}
|
}
|
||||||
|
|
||||||
state = XInternAtom(display, "_NET_WM_STATE", True);
|
state = XInternAtom(display, "_NET_WM_STATE", True);
|
||||||
modal = XInternAtom(display, "_NET_WM_STATE_MODAL", True);
|
skip = XInternAtom(display, "_NET_WM_STATE_SKIP_TASKBAR", True);
|
||||||
|
|
||||||
parent = XCreateWindow(display, RootWindow(display, 0),
|
win = XCreateWindow(display, RootWindow(display, 0),
|
||||||
x, y, w, h, 10, CopyFromParent, CopyFromParent,
|
x, y, w, h, 10, CopyFromParent, CopyFromParent,
|
||||||
CopyFromParent, 0, 0);
|
CopyFromParent, 0, 0);
|
||||||
child = XCreateWindow(display, RootWindow(display, 0),
|
|
||||||
x, y, w/2, h/2, 10, CopyFromParent, CopyFromParent,
|
|
||||||
CopyFromParent, 0, 0);
|
|
||||||
|
|
||||||
XSetWindowBackground(display,parent,WhitePixel(display,0));
|
XSetWindowBackground(display,win,WhitePixel(display,0));
|
||||||
XSetWindowBackground(display,child,BlackPixel(display,0));
|
|
||||||
|
|
||||||
XSetTransientForHint(display, child, parent);
|
XChangeProperty(display, win, state, XA_ATOM, 32,
|
||||||
XChangeProperty(display, child, state, XA_ATOM, 32,
|
PropModeReplace, (unsigned char*)&skip, 1);
|
||||||
PropModeReplace, (unsigned char*)&modal, 1);
|
|
||||||
|
|
||||||
XMapWindow(display, parent);
|
XMapWindow(display, win);
|
||||||
XMapWindow(display, child);
|
|
||||||
XFlush(display);
|
XFlush(display);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
Loading…
Reference in a new issue