summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-09-15 17:32:58 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-09-15 17:32:58 +0000
commit34b8262885c1eaef51043b20b72bd3b0bc8e8dbc (patch)
treeb4208036788e55e0ed61a5ceffeac9ab90ad693e /tools
parent969a0df111577727a32e7f59d3143267e31ae2cc (diff)
downloaddrakx-backup-do-not-use-34b8262885c1eaef51043b20b72bd3b0bc8e8dbc.tar
drakx-backup-do-not-use-34b8262885c1eaef51043b20b72bd3b0bc8e8dbc.tar.gz
drakx-backup-do-not-use-34b8262885c1eaef51043b20b72bd3b0bc8e8dbc.tar.bz2
drakx-backup-do-not-use-34b8262885c1eaef51043b20b72bd3b0bc8e8dbc.tar.xz
drakx-backup-do-not-use-34b8262885c1eaef51043b20b72bd3b0bc8e8dbc.zip
set_focus on new map_request event (fix summary step)
Diffstat (limited to 'tools')
-rw-r--r--tools/aewm-drakx/aewm-drakx.c3
-rw-r--r--tools/aewm-drakx/aewm.h4
-rw-r--r--tools/aewm-drakx/client.c3
-rw-r--r--tools/aewm-drakx/events.c1
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);
}