summaryrefslogtreecommitdiff
path: root/x-focus-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'x-focus-manager.c')
-rw-r--r--x-focus-manager.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/x-focus-manager.c b/x-focus-manager.c
index c9abdb8..c1fae73 100644
--- a/x-focus-manager.c
+++ b/x-focus-manager.c
@@ -24,49 +24,49 @@ If not, see http://creativecommons.org/publicdomain/zero/1.0/ */
void reset_focus(Display *d, XEvent *e);
static void (*handler[LASTEvent]) (Display *d, XEvent *) = {
- [UnmapNotify] = reset_focus,
- [DestroyNotify] = reset_focus
+ [UnmapNotify] = reset_focus,
+ [DestroyNotify] = reset_focus
};
/// fun on down
void
reset_focus(Display *d, XEvent *e) {
- XSetInputFocus(d, PointerRoot , RevertToPointerRoot, CurrentTime);
+ 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_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};
- 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 root = DefaultRootWindow(dpy);
+ Atom wm_change_state = XInternAtom(dpy,"_NET_WM_STATE",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};
+ 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;
- XEvent e;
- XSetWindowAttributes wa;
+ Display *dpy;
+ XEvent e;
+ XSetWindowAttributes wa;
- if(!(dpy = XOpenDisplay(NULL)))
- return 1;
+ if(!(dpy = XOpenDisplay(NULL)))
+ return 1;
- wa.cursor = XCreateFontCursor(dpy, XC_left_ptr);
- wa.event_mask = SubstructureNotifyMask|StructureNotifyMask;
- XChangeWindowAttributes(dpy, DefaultRootWindow(dpy) , CWEventMask|CWCursor, &wa);
- set_atoms(dpy);
+ 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);
- if(handler[e.type])
- handler[e.type](dpy, &e);
- }
+ for(;;) {
+ XNextEvent(dpy, &e);
+ if(handler[e.type])
+ handler[e.type](dpy, &e);
+ }
}