aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--monsterwm.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/monsterwm.c b/monsterwm.c
index 29d1aae..3c8d717 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -73,6 +73,7 @@ static void buttonpressed(XEvent *e);
static void change_desktop(const Arg *arg);
static void cleanup(void);
static void client_to_desktop(const Arg *arg);
+static void configurerequest(XEvent *e);
static void deletewindow(Window w);
static void destroynotify(XEvent *e);
static void die(const char* errstr, ...);
@@ -134,11 +135,12 @@ static desktop desktops[DESKTOPS];
/* events array */
static void (*events[LASTEvent])(XEvent *e) = {
- [KeyPress] = keypress,
- [MapRequest] = maprequest,
- [EnterNotify] = enternotify,
[ButtonPress] = buttonpressed,
+ [ConfigureRequest] = configurerequest,
[DestroyNotify] = destroynotify,
+ [EnterNotify] = enternotify,
+ [KeyPress] = keypress,
+ [MapRequest] = maprequest,
};
void add_window(Window w) {
@@ -238,6 +240,22 @@ void client_to_desktop(const Arg *arg) {
if(FOLLOW_WINDOW) change_desktop(arg);
}
+void configurerequest(XEvent *e) {
+ XConfigureRequestEvent *ev = &e->xconfigurerequest;
+ XWindowChanges wc;
+
+ wc.x = ev->x;
+ wc.y = ev->y + (showpanel && TOP_PANEL) ? PANEL_HEIGHT : 0;
+ wc.width = (ev->width < sw - BORDER_WIDTH) ? ev->width : sw + BORDER_WIDTH;
+ wc.height = (ev->height < sh - BORDER_WIDTH) ? ev->height : sh + BORDER_WIDTH;
+ wc.border_width = ev->border_width;
+ wc.sibling = ev->above;
+ wc.stack_mode = ev->detail;
+
+ XConfigureWindow(dis, ev->window, ev->value_mask, &wc);
+ XSync(dis, False);
+}
+
void deletewindow(Window w) {
XEvent ev;
ev.type = ClientMessage;