summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/conf.h6
-rw-r--r--src/events.c24
-rw-r--r--src/manage.c29
-rw-r--r--src/manage.h1
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
diff --git a/src/conf.h b/src/conf.h
index 395945c..fef2cdb 100644
--- a/src/conf.h
+++ b/src/conf.h
@@ -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);