From cd44d17e193012229153902220411bab581e06fd Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Tue, 25 Oct 2011 23:06:01 +0200 Subject: [PATCH] Fix screen_update_sel and configure event size given to fac_resize --- src/client.c | 4 +++- src/event.c | 4 ++-- src/screen.c | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/client.c b/src/client.c index 63f84c4..1722b88 100644 --- a/src/client.c +++ b/src/client.c @@ -528,7 +528,9 @@ client_frame_new(struct client *c) struct client* client_new(Window w, XWindowAttributes *wa) { - struct client *c = xcalloc(1, sizeof(struct client)); + struct client *c = NULL; + + c = xcalloc(1, sizeof(struct client)); /* C attributes */ c->win = w; diff --git a/src/event.c b/src/event.c index d2064c7..5cfbc2c 100644 --- a/src/event.c +++ b/src/event.c @@ -79,9 +79,9 @@ event_configureevent(XEvent *e) c->geo.y = ev->y; */ if(ev->value_mask & CWWidth) - _fac_resize(c, Right, (ev->width - c->geo.w)); + _fac_resize(c, Right, (ev->width - (c->geo.w - c->border - c->border))); if(ev->value_mask & CWHeight) - _fac_resize(c, Bottom, (ev->height - c->geo.h)); + _fac_resize(c, Bottom, (ev->height - (c->geo.h - c->tbarw))); client_apply_tgeo(c->tag); } diff --git a/src/screen.c b/src/screen.c index 8724dcd..277ec1c 100644 --- a/src/screen.c +++ b/src/screen.c @@ -90,6 +90,9 @@ screen_update_sel(void) if(INAREA(x, y, s->geo)) break; + if(!s) + s = SLIST_FIRST(&W->h.screen); + return (W->screen = s); } #endif /* HAVE_XINERAMA */