+ _type = XInternAtom(display, "_NET_WM_WINDOW_TYPE", False);
+ _normal = XInternAtom(display, "_NET_WM_WINDOW_TYPE_NORMAL", False);
+ _desktop = XInternAtom(display, "_NET_WM_WINDOW_TYPE_DESKTOP", False);
+ _request = XInternAtom(display, "_NET_REQUEST_FRAME_EXTENTS", False);
+ _extents = XInternAtom(display, "_NET_FRAME_EXTENTS", False);
+ _state = XInternAtom(display, "_NET_WM_STATE", False);
+ _state_fs = XInternAtom(display, "_NET_WM_STATE_FULLSCREEN", False);
+ _state_mh = XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
+ _state_mv = XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
+
+ win = XCreateWindow(display, RootWindow(display, 0),
+ x, y, w, h, 10, CopyFromParent, CopyFromParent,
+ CopyFromParent, 0, NULL);
+ XSelectInput(display, win, PropertyChangeMask);
+
+ printf("requesting for type normal\n");
+ XChangeProperty(display, win, _type, XA_ATOM, 32,
+ PropModeReplace, (unsigned char*)&_normal, 1);
+ request(display, _request, _extents, win);
+ reply(display, _extents);
+
+ printf("requesting for type normal+fullscreen\n");
+ XChangeProperty(display, win, _type, XA_ATOM, 32,
+ PropModeReplace, (unsigned char*)&_normal, 1);
+ XChangeProperty(display, win, _state, XA_ATOM, 32,
+ PropModeReplace, (unsigned char*)&_state_fs, 1);
+ request(display, _request, _extents, win);
+ reply(display, _extents);
+
+ printf("requesting for type normal+maxv\n");
+ XChangeProperty(display, win, _type, XA_ATOM, 32,
+ PropModeReplace, (unsigned char*)&_normal, 1);
+ XChangeProperty(display, win, _state, XA_ATOM, 32,
+ PropModeReplace, (unsigned char*)&_state_mv, 1);
+ request(display, _request, _extents, win);
+ reply(display, _extents);
+
+ printf("requesting for type normal+maxh\n");
+ XChangeProperty(display, win, _type, XA_ATOM, 32,
+ PropModeReplace, (unsigned char*)&_normal, 1);
+ XChangeProperty(display, win, _state, XA_ATOM, 32,
+ PropModeReplace, (unsigned char*)&_state_mh, 1);
+ request(display, _request, _extents, win);
+ reply(display, _extents);
+
+ printf("requesting for type desktop\n");
+ XChangeProperty(display, win, _type, XA_ATOM, 32,
+ PropModeReplace, (unsigned char*)&_desktop, 1);
+ request(display, _request, _extents, win);
+ reply(display, _extents);
+