Browse Source

Fix screen_update_sel and configure event size given to fac_resize

Martin Duquesnoy 12 years ago
parent
commit
cd44d17e19
3 changed files with 8 additions and 3 deletions
  1. 3 1
      src/client.c
  2. 2 2
      src/event.c
  3. 3 0
      src/screen.c

+ 3 - 1
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;

+ 2 - 2
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);
      }

+ 3 - 0
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 */