diff options
author | rcyeske <rcyeske> | 2000-10-20 02:54:20 +0000 |
---|---|---|
committer | rcyeske <rcyeske> | 2000-10-20 02:54:20 +0000 |
commit | 0026981538c8dc01368db4d4b32432c1140d9a38 (patch) | |
tree | c77b10b304c7aaa045ac7ee0a85630794e547235 | |
parent | 4b0e0a937fb526b3216acd04d5912bc3b95e857f (diff) | |
download | ratpoison-0026981538c8dc01368db4d4b32432c1140d9a38.zip |
added unmanaged windows and window padding
-rw-r--r-- | src/ChangeLog | 9 | ||||
-rw-r--r-- | src/conf.h | 6 | ||||
-rw-r--r-- | src/events.c | 24 | ||||
-rw-r--r-- | src/manage.c | 29 | ||||
-rw-r--r-- | src/manage.h | 1 |
5 files changed, 58 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index aa0d65b..25c9dfe 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2000-10-19 Ryan yeske <rcyeske@van.gobasis.com> + + * manage.c (unmanaged_window): added. + + * conf.h (PADDING_LEFT, PADDING_TOP, PADDING_RIGHT, + PADDING_BOTTOM, UNMANAGED_WINDOW_LIST): added. Windows listed in + UNMANAGED_WINDOW_LIST will not be managed. Space reserved for + unmanaged windows can be defined with PADDING_* + 2000-10-19 shawn <sabetts@badbox.secure.basis.org> * manage.c (get_window_name): added @@ -32,3 +32,9 @@ #define BAR_LOCATION 3 /* 0=bottom-left 1=top-left 2=bottom-right 3=top-right */ #define BAR_TIMEOUT 5 /* Number of seconds before the progam bar autohides 0=don't autohide */ +#define PADDING_LEFT 100 /* space not to be taken up around managed windows */ +#define PADDING_TOP 100 +#define PADDING_RIGHT 100 +#define PADDING_BOTTOM 100 + +#define UNMANAGED_WINDOW_LIST "xapm","xclock","xscribble" diff --git a/src/events.c b/src/events.c index 5f2e11d..2c75b41 100644 --- a/src/events.c +++ b/src/events.c @@ -99,7 +99,13 @@ map_request (XEvent *ev) switch (win->state) { case STATE_UNMAPPED: - manage (win, s); + if (unmanaged_window (win->w)) + { + XMapRaised (dpy, win->w); + break; + } + else + manage (win, s); /* fall through */ case STATE_MAPPED: XMapRaised (dpy, win->w); rp_current_window = win; @@ -168,19 +174,19 @@ configure_request (XConfigureRequestEvent *e) { PRINT_DEBUG ("window req: %d %d %d %d %d\n", e->x, e->y, e->width, e->height, e->border_width); - wc.x = 0; - wc.y = 0; - wc.width = win->scr->root_attr.width - 1; - wc.height = win->scr->root_attr.height - 1; + wc.x = PADDING_LEFT; + wc.y = PADDING_TOP; + wc.width = win->scr->root_attr.width - PADDING_LEFT - PADDING_RIGHT; + wc.height = win->scr->root_attr.height - PADDING_TOP - PADDING_BOTTOM; wc.border_width = 0; ce.type = ConfigureNotify; ce.event = e->window; ce.window = e->window; - ce.x = 0; - ce.y = 0; - ce.width = win->scr->root_attr.width - 1; - ce.height = win->scr->root_attr.height - 1; + ce.x = PADDING_LEFT; + ce.y = PADDING_TOP; + ce.width = win->scr->root_attr.width - PADDING_LEFT - PADDING_RIGHT; + ce.height = win->scr->root_attr.height - PADDING_TOP - PADDING_BOTTOM; ce.border_width = 0; ce.above = None; ce.override_redirect = 0; diff --git a/src/manage.c b/src/manage.c index af6cc16..c46509d 100644 --- a/src/manage.c +++ b/src/manage.c @@ -30,6 +30,13 @@ #include "ratpoison.h" +const char *unmanaged_window_list[] = { +#ifdef UNMANAGED_WINDOW_LIST + UNMANAGED_WINDOW_LIST, +#endif + NULL +}; + extern Atom wm_state; static void @@ -109,7 +116,11 @@ manage (rp_window *win, screen_info *s) /* We successfully got the name, which means we can start managing! */ XMapWindow (dpy, win->w); - XMoveResizeWindow (dpy, win->w, 0, 0, s->root_attr.width, s->root_attr.height); + XMoveResizeWindow (dpy, win->w, + PADDING_LEFT, + PADDING_TOP, + s->root_attr.width - PADDING_LEFT - PADDING_RIGHT, + s->root_attr.height - PADDING_TOP - PADDING_BOTTOM); XSelectInput (dpy, win->w, PropertyChangeMask); XAddToSaveSet(dpy, win->w); grab_prefix_key (win->w); @@ -144,8 +155,9 @@ scanwins(screen_info *s) XGetWindowAttributes(dpy, wins[i], &attr); if (wins[i] == s->bar_window || wins[i] == s->key_window || wins[i] == s->input_window) continue; - if (attr.override_redirect != True) + if (attr.override_redirect != True && !unmanaged_window (wins[i])) { + win = add_to_window_list (s, wins[i]); PRINT_DEBUG ("map_state: %d\n", attr.map_state); if (attr.map_state == IsViewable) manage (win, s); @@ -153,3 +165,16 @@ scanwins(screen_info *s) } XFree((void *) wins); /* cast is to shut stoopid compiler up */ } + +int +unmanaged_window (Window w) +{ + int i; + + for (i = 0; unmanaged_window_list[i]; i++) + if (!strcmp (unmanaged_window_list[i], get_window_name (w))) + return 1; + + return 0; +} + diff --git a/src/manage.h b/src/manage.h index 58a5590..75801a4 100644 --- a/src/manage.h +++ b/src/manage.h @@ -22,6 +22,7 @@ #include "data.h" +int unmanaged_window (Window w); void scanwins(screen_info *s); void manage (rp_window *w, screen_info *s); void unmanage (rp_window *w); |