diff options
-rw-r--r-- | tools/aewm-drakx/aewm-drakx.c | 3 | ||||
-rw-r--r-- | tools/aewm-drakx/aewm.h | 4 | ||||
-rw-r--r-- | tools/aewm-drakx/client.c | 3 | ||||
-rw-r--r-- | tools/aewm-drakx/events.c | 1 |
4 files changed, 5 insertions, 6 deletions
diff --git a/tools/aewm-drakx/aewm-drakx.c b/tools/aewm-drakx/aewm-drakx.c index f550271c7..4df2544af 100644 --- a/tools/aewm-drakx/aewm-drakx.c +++ b/tools/aewm-drakx/aewm-drakx.c @@ -7,7 +7,6 @@ Display *dpy; Window root; -Atom wm_state; static void scan_wins(void) { @@ -38,8 +37,6 @@ static void setup_display(void) XSetErrorHandler(handle_xerror); root = RootWindow(dpy, DefaultScreen(dpy)); - wm_state = XInternAtom(dpy, "WM_STATE", False); - sattr.event_mask = SubstructureRedirectMask|SubstructureNotifyMask; XChangeWindowAttributes(dpy, root, CWEventMask, &sattr); } diff --git a/tools/aewm-drakx/aewm.h b/tools/aewm-drakx/aewm.h index d5c8a8b0e..1f2f11f1f 100644 --- a/tools/aewm-drakx/aewm.h +++ b/tools/aewm-drakx/aewm.h @@ -15,13 +15,13 @@ struct _Client { }; extern Display *dpy; -extern Atom wm_state; /* events.c */ extern void do_event_loop(void); /* client.c */ extern Client *find_client(Window); +extern void set_focus_on(Window w); extern void set_wm_state(Client *, int); extern void remove_client(Client *); extern void make_new_client(Window); @@ -30,3 +30,5 @@ extern void make_new_client(Window); void err(const char *, ...); int handle_xerror(Display *, XErrorEvent *); + +#define wm_state XInternAtom(dpy, "WM_STATE", False) diff --git a/tools/aewm-drakx/client.c b/tools/aewm-drakx/client.c index 6f38f3150..8db6b2151 100644 --- a/tools/aewm-drakx/client.c +++ b/tools/aewm-drakx/client.c @@ -18,7 +18,6 @@ Client *find_client(Window w) return NULL; } - void set_focus_on(Window w) { char *name; @@ -26,7 +25,7 @@ void set_focus_on(Window w) if (name && strcmp(name, "skip")) { XSetInputFocus(dpy, w, RevertToPointerRoot, CurrentTime); #ifdef DEBUG - printf("aewm-drakx: adding %ld %s\n", w, name); + printf("aewm-drakx: adding %lx %s\n", w, name); #endif } } diff --git a/tools/aewm-drakx/events.c b/tools/aewm-drakx/events.c index 4a6ba53a4..f9a387e1e 100644 --- a/tools/aewm-drakx/events.c +++ b/tools/aewm-drakx/events.c @@ -25,6 +25,7 @@ static void handle_map_request(XMapRequestEvent *e) if (c) { XMapWindow(dpy, c->window); set_wm_state(c, NormalState); + set_focus_on(c->window); } else { make_new_client(e->window); } |