Skip to content

Commit

Permalink
Fixed PropUpdateManage segfaulting and slow downs
Browse files Browse the repository at this point in the history
  • Loading branch information
DerjenigeUberMensch committed Oct 10, 2024
1 parent d940c42 commit 9110a31
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions src/prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ PropUpdateManage(
const XCBWindow win = cookie->win;
Client *c;
Client *cf = NULL; /* client focus */
u32 hidden = 0;
XCBCookie requests[ManageClientLAST];
void *replies[ManageClientLAST];

Expand All @@ -505,41 +504,25 @@ PropUpdateManage(
if(c)
{
/* Dont waste extra resources if not visible */
hidden = !ISVISIBLE(c);
if(!hidden)
if(ISVISIBLE(c))
{
cf = focusrealize(c);
arrange(c->desktop);
}
else
{ showhide(c);
}
setmapstate(c, WMMapStateMapped);
}
else if(_wm.selmon->bar && _wm.selmon->bar->win == win)
{
cf = focusrealize(NULL);
arrange(_wm.selmon->desksel);
hidden = 1;
}

Monitor *selmon = _wm.selmon;
i16 mx = selmon->mx;
i16 my = selmon->my;
u16 mw = selmon->mw;
u16 mh = selmon->mh;

if(c && !hidden)
{ XCBMoveWindow(_wm.dpy, c->win, mx + mw, my + mh);
}

setmapstate(c, WMMapStateMapped);
XCBMapWindow(_wm.dpy, win);
focus(cf);

if(c && !hidden)
{ XCBMoveWindow(_wm.dpy, c->win, c->x, c->y);
}

XCBFlush(_wm.dpy);
UnlockMainThread();
managecleanup(replies);
Expand Down

0 comments on commit 9110a31

Please sign in to comment.