Ver código fonte

Fix configureevent with free mode, set hinted client as free

Martin Duquesnoy 12 anos atrás
pai
commit
409d26bf7b
3 arquivos alterados com 24 adições e 6 exclusões
  1. 3 0
      src/client.c
  2. 21 5
      src/event.c
  3. 0 1
      src/layout.c

+ 3 - 0
src/client.c

@@ -904,6 +904,9 @@ client_new(Window w, XWindowAttributes *wa, bool scan)
      /* Set tag */
      client_get_sizeh(c);
 
+     if(c->flags & CLIENT_HINT_FLAG /* && OPTIONKIVABIEN */)
+          c->flags |= CLIENT_FREE;
+
      if(!scan)
           tag_client((c->flags & CLIENT_RULED ? c->tag : c->screen->seltag), c);
 

+ 21 - 5
src/event.c

@@ -132,12 +132,28 @@ event_configureevent(XEvent *e)
 
      if((c = client_gb_win(ev->window)))
      {
-          if(ev->value_mask & CWWidth)
-               _fac_resize(c, Right, ev->width - c->wgeo.w);
-          if(ev->value_mask & CWHeight)
-               _fac_resize(c, Bottom, ev->height - c->wgeo.h);
+          if(c->flags & CLIENT_FREE)
+          {
+               if(ev->value_mask & CWX)
+                    c->geo.x = ev->x;
+               if(ev->value_mask & CWY)
+                    c->geo.y = ev->y;
+               if(ev->value_mask & CWWidth)
+                    c->geo.w = ev->width + c->border + c->border;
+               if(ev->value_mask & CWHeight)
+                    c->geo.h = ev->height + c->tbarw + c->border;
+
+               client_moveresize(c, &c->geo);
+          }
+          else
+          {
+               if(ev->value_mask & CWWidth)
+                    _fac_resize(c, Right, ev->width - c->wgeo.w);
+               if(ev->value_mask & CWHeight)
+                    _fac_resize(c, Bottom, ev->height - c->wgeo.h);
 
-          client_apply_tgeo(c->tag);
+               client_apply_tgeo(c->tag);
+          }
      }
      else
      {

+ 0 - 1
src/layout.c

@@ -319,7 +319,6 @@ layout_split_arrange_closed(struct client *ghost)
      bool b = false;
      enum position p;
 
-
      /* Search for single parent for easy resize
       * Example case:
       *  ___________               ___________