switch to get_current_tags() in event.c

This commit is contained in:
Julien Danjou 2007-12-27 13:14:20 +01:00
parent 1fb83771f0
commit 7099794c64
1 changed files with 8 additions and 3 deletions

11
event.c
View File

@ -134,14 +134,16 @@ handle_event_configurerequest(XEvent * e)
XConfigureRequestEvent *ev = &e->xconfigurerequest; XConfigureRequestEvent *ev = &e->xconfigurerequest;
XWindowChanges wc; XWindowChanges wc;
int old_screen; int old_screen;
Tag **curtags;
if((c = get_client_bywin(globalconf.clients, ev->window))) if((c = get_client_bywin(globalconf.clients, ev->window)))
{ {
c->ismax = False; c->ismax = False;
curtags = get_current_tags(c->screen);
if(ev->value_mask & CWBorderWidth) if(ev->value_mask & CWBorderWidth)
c->border = ev->border_width; c->border = ev->border_width;
if(c->isfixed || c->isfloating if(c->isfixed || c->isfloating
|| get_current_layout(c->screen)->arrange == layout_floating) || curtags[0]->layout->arrange == layout_floating)
{ {
if(ev->value_mask & CWX) if(ev->value_mask & CWX)
c->rx = c->x = ev->x; c->rx = c->x = ev->x;
@ -168,6 +170,7 @@ handle_event_configurerequest(XEvent * e)
} }
else else
window_configure(c->display, c->win, c->x, c->y, c->w, c->h, c->border); window_configure(c->display, c->win, c->x, c->y, c->w, c->h, c->border);
p_delete(&curtags);
} }
else else
{ {
@ -228,15 +231,17 @@ handle_event_enternotify(XEvent * e)
Client *c; Client *c;
XCrossingEvent *ev = &e->xcrossing; XCrossingEvent *ev = &e->xcrossing;
int screen; int screen;
Tag **curtags;
if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
return; return;
if((c = get_client_bywin(globalconf.clients, ev->window))) if((c = get_client_bywin(globalconf.clients, ev->window)))
{ {
curtags = get_current_tags(c->screen);
focus(c, ev->same_screen, c->screen); focus(c, ev->same_screen, c->screen);
if (c->isfloating if (c->isfloating || curtags[0]->layout->arrange == layout_floating)
|| get_current_layout(c->screen)->arrange == layout_floating)
window_grabbuttons(c->display, c->phys_screen, c->win, True, False); window_grabbuttons(c->display, c->phys_screen, c->win, True, False);
p_delete(curtags);
} }
else else
for(screen = 0; screen < ScreenCount(e->xany.display); screen++) for(screen = 0; screen < ScreenCount(e->xany.display); screen++)