tag: Remove useless stuff in tagtransfert (can segfault)
This commit is contained in:
parent
17716ae54f
commit
bc1d19a6bc
@ -151,7 +151,7 @@ updatebutton(Bool c)
|
|||||||
int y = 0, hi = 0;
|
int y = 0, hi = 0;
|
||||||
|
|
||||||
/* Calcul the position of the first button with the layout image size */
|
/* Calcul the position of the first button with the layout image size */
|
||||||
j = taglen[conf.ntag] + textw(tags[seltag].layout.symbol) + PAD*1.5;
|
j = taglen[conf.ntag] + textw(tags[seltag].layout.symbol) + PAD/2;
|
||||||
|
|
||||||
if(!conf.bartop)
|
if(!conf.bartop)
|
||||||
y = bary + 2;
|
y = bary + 2;
|
||||||
|
|||||||
19
src/client.c
19
src/client.c
@ -304,6 +304,7 @@ client_moveresize(Client *c, XRectangle geo, bool r)
|
|||||||
{
|
{
|
||||||
if(!c)
|
if(!c)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Resize hints {{{ */
|
/* Resize hints {{{ */
|
||||||
if(r)
|
if(r)
|
||||||
{
|
{
|
||||||
@ -312,9 +313,11 @@ client_moveresize(Client *c, XRectangle geo, bool r)
|
|||||||
geo.width = 1;
|
geo.width = 1;
|
||||||
if (geo.height < 1)
|
if (geo.height < 1)
|
||||||
geo.height = 1;
|
geo.height = 1;
|
||||||
|
|
||||||
/* base */
|
/* base */
|
||||||
geo.width -= c->basew;
|
geo.width -= c->basew;
|
||||||
geo.height -= c->baseh;
|
geo.height -= c->baseh;
|
||||||
|
|
||||||
/* aspect */
|
/* aspect */
|
||||||
if (c->minay > 0 && c->maxay > 0
|
if (c->minay > 0 && c->maxay > 0
|
||||||
&& c->minax > 0 && c->maxax > 0)
|
&& c->minax > 0 && c->maxax > 0)
|
||||||
@ -324,11 +327,13 @@ client_moveresize(Client *c, XRectangle geo, bool r)
|
|||||||
else if (geo.width * c->minay < geo.height * c->minax)
|
else if (geo.width * c->minay < geo.height * c->minax)
|
||||||
geo.height = geo.width * c->minay / c->minax;
|
geo.height = geo.width * c->minay / c->minax;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* incremental */
|
/* incremental */
|
||||||
if(c->incw)
|
if(c->incw)
|
||||||
geo.width -= geo.width % c->incw;
|
geo.width -= geo.width % c->incw;
|
||||||
if(c->inch)
|
if(c->inch)
|
||||||
geo.height -= geo.height % c->inch;
|
geo.height -= geo.height % c->inch;
|
||||||
|
|
||||||
/* base dimension */
|
/* base dimension */
|
||||||
geo.width += c->basew;
|
geo.width += c->basew;
|
||||||
geo.height += c->baseh;
|
geo.height += c->baseh;
|
||||||
@ -385,6 +390,7 @@ client_size_hints(Client *c)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
c->basew = c->baseh = 0;
|
c->basew = c->baseh = 0;
|
||||||
|
|
||||||
/* inc */
|
/* inc */
|
||||||
if(size.flags & PResizeInc)
|
if(size.flags & PResizeInc)
|
||||||
{
|
{
|
||||||
@ -393,6 +399,7 @@ client_size_hints(Client *c)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
c->incw = c->inch = 0;
|
c->incw = c->inch = 0;
|
||||||
|
|
||||||
/* max */
|
/* max */
|
||||||
if(size.flags & PMaxSize)
|
if(size.flags & PMaxSize)
|
||||||
{
|
{
|
||||||
@ -401,6 +408,7 @@ client_size_hints(Client *c)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
c->maxw = c->maxh = 0;
|
c->maxw = c->maxh = 0;
|
||||||
|
|
||||||
/* min */
|
/* min */
|
||||||
if(size.flags & PMinSize)
|
if(size.flags & PMinSize)
|
||||||
{
|
{
|
||||||
@ -409,10 +417,12 @@ client_size_hints(Client *c)
|
|||||||
}
|
}
|
||||||
else if(size.flags & PBaseSize)
|
else if(size.flags & PBaseSize)
|
||||||
{
|
{
|
||||||
c->minw = size.base_width; c->minh = size.base_height;
|
c->minw = size.base_width;
|
||||||
|
c->minh = size.base_height;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
c->minw = c->minh = 0;
|
c->minw = c->minh = 0;
|
||||||
|
|
||||||
/* aspect */
|
/* aspect */
|
||||||
if(size.flags & PAspect)
|
if(size.flags & PAspect)
|
||||||
{
|
{
|
||||||
@ -422,6 +432,7 @@ client_size_hints(Client *c)
|
|||||||
c->maxay = size.max_aspect.y;
|
c->maxay = size.max_aspect.y;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
||||||
c->minax = c->maxax = c->minay = c->maxay = 0;
|
c->minax = c->maxax = c->minay = c->maxay = 0;
|
||||||
c->hint = (c->maxw && c->minw && c->maxh && c->minh
|
c->hint = (c->maxw && c->minw && c->maxh && c->minh
|
||||||
&& c->maxw == c->minw && c->maxh == c->minh);
|
&& c->maxw == c->minw && c->maxh == c->minh);
|
||||||
@ -452,10 +463,8 @@ client_unhide(Client *c)
|
|||||||
return;
|
return;
|
||||||
XMoveWindow(dpy, c->win, c->geo.x, c->geo.y + conf.ttbarheight);
|
XMoveWindow(dpy, c->win, c->geo.x, c->geo.y + conf.ttbarheight);
|
||||||
if(conf.ttbarheight)
|
if(conf.ttbarheight)
|
||||||
bar_moveresize(c->tbar,
|
bar_moveresize(c->tbar, c->geo.x,
|
||||||
c->geo.x,
|
c->geo.y, c->geo.width, conf.ttbarheight);
|
||||||
c->geo.y,
|
|
||||||
c->geo.width, conf.ttbarheight);
|
|
||||||
setwinstate(c->win, NormalState);
|
setwinstate(c->win, NormalState);
|
||||||
c->hide = False;
|
c->hide = False;
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,6 @@ uicb_tag_prev(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_tagtransfert(uicb_t cmd)
|
uicb_tagtransfert(uicb_t cmd)
|
||||||
{
|
{
|
||||||
Client *c;
|
|
||||||
int n = atoi(cmd);
|
int n = atoi(cmd);
|
||||||
|
|
||||||
if(!sel)
|
if(!sel)
|
||||||
@ -92,8 +91,6 @@ uicb_tagtransfert(uicb_t cmd)
|
|||||||
|
|
||||||
sel->tag = n;
|
sel->tag = n;
|
||||||
selbytag[n] = sel;
|
selbytag[n] = sel;
|
||||||
c = (sel->next->tag == seltag) ? sel->next : NULL;
|
|
||||||
client_focus(((c) ? c : NULL));
|
|
||||||
|
|
||||||
arrange();
|
arrange();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user