diff options
| author | Patrick Haller <patrick@haller.ws> | 2011-06-11 11:29:23 +0800 |
|---|---|---|
| committer | Patrick Haller <patrick@haller.ws> | 2011-06-11 11:29:23 +0800 |
| commit | f01c8739a2cf9cc48509c1a4fdb92774810f14a2 (patch) | |
| tree | c9b3497ca827d85feaf89e6b1a48238262fd7175 | |
| parent | dd99fa8efde34206e374c25c275c980b661ec9c5 (diff) | |
trivial change
| -rw-r--r-- | x-focus-manager.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/x-focus-manager.c b/x-focus-manager.c index 5ebba4e..d6c90a0 100644 --- a/x-focus-manager.c +++ b/x-focus-manager.c @@ -1,6 +1,7 @@ #include <X11/Xlib.h> #include <X11/Xproto.h> #include <X11/cursorfont.h> +#include <X11/Xatom.h> /* some clients fail to reset focus on exit * we watch for that, and fix it @@ -24,6 +25,21 @@ reset_focus(Display *d, XEvent *e) { XSetInputFocus(d, PointerRoot , RevertToPointerRoot, CurrentTime); } +void set_atoms(Display *dpy) { // from scrotwm via euclid-wm + int root = DefaultRootWindow(dpy); + Atom wm_change_state = XInternAtom(dpy,"_NET_WM_STATE",False); + Atom wm_fullscreen = XInternAtom(dpy,"_NET_WM_STATE_FULLSCREEN",False); + Atom wm_supported = XInternAtom(dpy,"_NET_SUPPORTED",False); + Atom wm_check = XInternAtom(dpy,"_NET_SUPPORTING_WM_CHECK",False); + Atom wm_name = XInternAtom(dpy,"_NET_WM_NAME",False); + Atom utf8 = XInternAtom(dpy,"UTF8_STRING",False); + Atom supported[] = {wm_supported, wm_name, wm_change_state, wm_fullscreen}; + XChangeProperty(dpy,root,wm_check,XA_WINDOW,32,PropModeReplace,(unsigned char *)&root,1); + XChangeProperty(dpy,root,wm_name,utf8,8,PropModeReplace,(unsigned char *) "LG3D",5); + XChangeProperty(dpy,root,wm_supported,XA_ATOM,32,PropModeReplace,(unsigned char *) supported,4); + XSync(dpy,False); +} + int main(int argc, char **argv) { Display *dpy; @@ -36,6 +52,7 @@ main(int argc, char **argv) { wa.cursor = XCreateFontCursor(dpy, XC_left_ptr); wa.event_mask = SubstructureNotifyMask|StructureNotifyMask; XChangeWindowAttributes(dpy, DefaultRootWindow(dpy) , CWEventMask|CWCursor, &wa); + set_atoms(dpy); for(;;) { XNextEvent(dpy, &e); |
