diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-09-15 13:41:51 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-09-15 13:41:51 +0000 |
commit | ae1ca0772cea076c0098a83c15de2581e8aee3f5 (patch) | |
tree | 3df8809b28956670bca8ba3b447409c5d8bdfdd5 /tools/aewm-drakx/aewm-drakx.c | |
parent | 1e19a1f7ea181f9fd40e0f81ac3b7fda8563d391 (diff) | |
download | drakx-ae1ca0772cea076c0098a83c15de2581e8aee3f5.tar drakx-ae1ca0772cea076c0098a83c15de2581e8aee3f5.tar.gz drakx-ae1ca0772cea076c0098a83c15de2581e8aee3f5.tar.bz2 drakx-ae1ca0772cea076c0098a83c15de2581e8aee3f5.tar.xz drakx-ae1ca0772cea076c0098a83c15de2581e8aee3f5.zip |
- add and use aewm-drakx
- add some "skip" title on help/logo/steps windows so that aewm-drakx know they don't need keyboard focus
- add some more title to ease debugging (when aewm-drakx is in debug mode)
Diffstat (limited to 'tools/aewm-drakx/aewm-drakx.c')
-rw-r--r-- | tools/aewm-drakx/aewm-drakx.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tools/aewm-drakx/aewm-drakx.c b/tools/aewm-drakx/aewm-drakx.c new file mode 100644 index 000000000..f550271c7 --- /dev/null +++ b/tools/aewm-drakx/aewm-drakx.c @@ -0,0 +1,53 @@ +/* aewm - a minimalistic X11 window manager. ------- vim:sw=4:et + * Copyright (c) 1998-2001 Decklin Foster <decklin@red-bean.com> + * Free software! Please see README for details and license. */ + +#include "aewm.h" + + +Display *dpy; +Window root; +Atom wm_state; + +static void scan_wins(void) +{ + unsigned int nwins, i; + Window dummyw1, dummyw2, *wins; + XWindowAttributes attr; + + XQueryTree(dpy, root, &dummyw1, &dummyw2, &wins, &nwins); + for (i = 0; i < nwins; i++) { + XGetWindowAttributes(dpy, wins[i], &attr); + if (!attr.override_redirect && attr.map_state == IsViewable) + make_new_client(wins[i]); + } + XFree(wins); +} + +static void setup_display(void) +{ + XSetWindowAttributes sattr; + + dpy = XOpenDisplay(NULL); + + if (!dpy) { + err("can't open display! check your DISPLAY variable."); + exit(1); + } + + 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); +} + + +int main() +{ + setup_display(); + scan_wins(); + do_event_loop(); +} |