Client: Improve client_manage with split

This commit is contained in:
Martin Duquesnoy
2011-05-16 23:16:53 +02:00
parent 825620b25c
commit 1ba4a0ad46
2 changed files with 12 additions and 18 deletions

View File

@@ -888,7 +888,7 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
XSetWindowBorderWidth(dpy, c->win, 0); XSetWindowBorderWidth(dpy, c->win, 0);
mouse_grabbuttons(c, False); mouse_grabbuttons(c, False);
/* Transient */ /* Transient for tag setting */
if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success)) if((rettrans = XGetTransientForHint(dpy, w, &trans) == Success))
for(t = clients; t && t->win != trans; t = t->next); for(t = clients; t && t->win != trans; t = t->next);
@@ -897,46 +897,41 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
c->tag = t->tag; c->tag = t->tag;
c->screen = t->screen; c->screen = t->screen;
} }
if(!(c->flags & FreeFlag) if(!(c->flags & FreeFlag)
&& (rettrans == Success || (c->flags & HintFlag))) && (rettrans == Success || (c->flags & HintFlag)))
c->flags |= FreeFlag; c->flags |= FreeFlag;
free(t); free(t);
/* Handle client from here */
client_attach(c); client_attach(c);
client_set_rules(c); client_set_rules(c);
client_get_name(c);
tags[c->screen][c->tag].cleanfact = True; tags[c->screen][c->tag].cleanfact = True;
client_get_name(c); /* Case of split layout */
split_client_integrate(c, sel);
/* If client will be visible soon so.. */
if(c->tag == (uint)seltag[selscreen]) if(c->tag == (uint)seltag[selscreen])
{ {
client_raise(c);
setwinstate(c->win, NormalState); setwinstate(c->win, NormalState);
client_raise(c);
client_map(c);
client_focus(c);
} }
else else
client_hide(c); client_hide(c);
ewmh_get_client_list();
client_update_attributes(c);
if(c->tag == (uint)seltag[selscreen])
client_map(c);
ewmh_manage_window_type(c); ewmh_manage_window_type(c);
/* Need arrange for dynamic layouts */
if(ar) if(ar)
arrange(c->screen, True); arrange(c->screen, True);
split_client_integrate(c, sel);
if(!conf.client.set_new_win_master) if(!conf.client.set_new_win_master)
layout_set_client_master(c); layout_set_client_master(c);
if(c->tag == (uint)seltag[selscreen])
client_focus(c);
if(conf.client.new_client_get_mouse) if(conf.client.new_client_get_mouse)
{ {
/* Move pointer on client */ /* Move pointer on client */
@@ -946,7 +941,6 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
c->geo.y + c->geo.height / 2); c->geo.y + c->geo.height / 2);
} }
return c; return c;
} }

View File

@@ -129,10 +129,10 @@ split_arrange_closed(Client ghost)
return; return;
} }
/** Split client hor or vert to insert another client in the new area /** Split client hor or vert to insert another client in the new area
*\param c Client pointer *\param c Client pointer
*\param p True = Vertical, False = Horizontal *\param p True = Vertical, False = Horizontal
*\return sgeo Geo of future integrated client
*/ */
XRectangle XRectangle
split_client(Client *c, Bool p) split_client(Client *c, Bool p)