fix stacking issues

This commit is contained in:
Julien Danjou 2008-02-12 14:39:52 +01:00
parent 68affe21fd
commit a84eae2700
2 changed files with 30 additions and 9 deletions

View File

@ -201,7 +201,24 @@ client_focus(Client *c, int screen, Bool raise)
globalconf.screens[screen].colors_selected[ColBorder].pixel); globalconf.screens[screen].colors_selected[ColBorder].pixel);
XSetInputFocus(globalconf.display, c->win, RevertToPointerRoot, CurrentTime); XSetInputFocus(globalconf.display, c->win, RevertToPointerRoot, CurrentTime);
if(raise) if(raise)
{
XWindowChanges wc;
Layout *curlay = layout_get_current(screen);
if(c->isfloating || curlay->arrange == layout_floating)
XRaiseWindow(globalconf.display, c->win); XRaiseWindow(globalconf.display, c->win);
else
{
Client *client;
wc.stack_mode = Below;
wc.sibling = c->win;
for(client = globalconf.clients; client; client = client->next)
if(client != c && IS_TILED(client, c->screen))
{
XConfigureWindow(globalconf.display, client->win, CWSibling | CWStackMode, &wc);
wc.sibling = client->win;
}
}
}
/* since we're dropping EnterWindow events and sometimes the window /* since we're dropping EnterWindow events and sometimes the window
* will appear under the mouse, grabbuttons */ * will appear under the mouse, grabbuttons */
window_grabbuttons(phys_screen, c->win); window_grabbuttons(phys_screen, c->win);
@ -530,12 +547,19 @@ client_setfloating(Client *c, Bool floating)
if(c->isfloating != floating) if(c->isfloating != floating)
{ {
if((c->isfloating = floating)) if((c->isfloating = floating))
{
client_resize(c, c->f_geometry, False); client_resize(c, c->f_geometry, False);
else if(c->ismax) XRaiseWindow(globalconf.display, c->win);
}
else
{
XLowerWindow(globalconf.display, c->win);
if(c->ismax)
{ {
c->ismax = False; c->ismax = False;
client_resize(c, c->m_geometry, False); client_resize(c, c->m_geometry, False);
} }
}
if(client_isvisible(c, c->screen)) if(client_isvisible(c, c->screen))
globalconf.screens[c->screen].need_arrange = True; globalconf.screens[c->screen].need_arrange = True;
widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS);

View File

@ -54,9 +54,6 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
if(!c) if(!c)
return; return;
/* go above everybody */
XMapRaised(globalconf.display, c->win);
area = screen_get_area(c->screen, area = screen_get_area(c->screen,
globalconf.screens[screen].statusbar, globalconf.screens[screen].statusbar,
&globalconf.screens[screen].padding); &globalconf.screens[screen].padding);
@ -127,7 +124,7 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
layout_refresh(); layout_refresh();
} }
if((target = client_get_bywin(globalconf.clients, child)) if((target = client_get_bywin(globalconf.clients, child))
&& target != c) && target != c && !target->isfloating)
{ {
client_list_swap(&globalconf.clients, c, target); client_list_swap(&globalconf.clients, c, target);
globalconf.screens[c->screen].need_arrange = True; globalconf.screens[c->screen].need_arrange = True;