stop dropping EnterWindow event

and make statusbar_update_position static
This commit is contained in:
Julien Danjou 2008-01-10 20:53:31 +01:00
parent 81f1b96cb2
commit 2aacaa9320
4 changed files with 33 additions and 40 deletions

View File

@ -169,7 +169,6 @@ void
restack(int screen) restack(int screen)
{ {
Client *c, *sel = globalconf.focus->client; Client *c, *sel = globalconf.focus->client;
XEvent ev;
XWindowChanges wc; XWindowChanges wc;
Tag **curtags; Tag **curtags;
@ -202,7 +201,6 @@ restack(int screen)
XWarpPointer(globalconf.display, None, sel->win, 0, 0, 0, 0, XWarpPointer(globalconf.display, None, sel->win, 0, 0, 0, 0,
sel->geometry.width / 2, sel->geometry.height / 2); sel->geometry.width / 2, sel->geometry.height / 2);
XSync(globalconf.display, False); XSync(globalconf.display, False);
while(XCheckMaskEvent(globalconf.display, EnterWindowMask, &ev));
} }
void void

View File

@ -177,7 +177,6 @@ uicb_client_resizemouse(int screen, char *arg __attribute__ ((unused)))
{ {
case ButtonRelease: case ButtonRelease:
XUngrabPointer(globalconf.display, CurrentTime); XUngrabPointer(globalconf.display, CurrentTime);
while(XCheckMaskEvent(globalconf.display, EnterWindowMask, &ev));
return; return;
case ConfigureRequest: case ConfigureRequest:
handle_event_configurerequest(&ev); handle_event_configurerequest(&ev);

View File

@ -30,6 +30,39 @@
extern AwesomeConf globalconf; extern AwesomeConf globalconf;
static void
statusbar_update_position(Statusbar *statusbar)
{
Area area = get_screen_area(statusbar->screen,
NULL,
&globalconf.screens[statusbar->screen].padding);
XMapRaised(globalconf.display, statusbar->window);
switch(statusbar->position)
{
default:
XMoveWindow(globalconf.display, statusbar->window,
area.x, area.y);
break;
case Left:
XMoveWindow(globalconf.display, statusbar->window,
area.x, (area.y + area.height) - statusbar->width);
break;
case Right:
XMoveWindow(globalconf.display, statusbar->window,
area.x + (area.width - statusbar->height), area.y);
break;
case Bottom:
XMoveWindow(globalconf.display, statusbar->window,
area.x, area.height - statusbar->height);
break;
case Off:
XUnmapWindow(globalconf.display, statusbar->window);
break;
}
XSync(globalconf.display, False);
}
void void
statusbar_draw(Statusbar *statusbar) statusbar_draw(Statusbar *statusbar)
{ {
@ -206,42 +239,6 @@ statusbar_init(Statusbar *statusbar, int screen)
statusbar_draw(statusbar); statusbar_draw(statusbar);
} }
void
statusbar_update_position(Statusbar *statusbar)
{
XEvent ev;
Area area = get_screen_area(statusbar->screen,
NULL,
&globalconf.screens[statusbar->screen].padding);
XMapRaised(globalconf.display, statusbar->window);
switch(statusbar->position)
{
default:
XMoveWindow(globalconf.display, statusbar->window,
area.x, area.y);
break;
case Left:
XMoveWindow(globalconf.display, statusbar->window,
area.x, (area.y + area.height) - statusbar->width);
break;
case Right:
XMoveWindow(globalconf.display, statusbar->window,
area.x + (area.width - statusbar->height), area.y);
break;
case Bottom:
XMoveWindow(globalconf.display, statusbar->window,
area.x, area.height - statusbar->height);
break;
case Off:
XUnmapWindow(globalconf.display, statusbar->window);
break;
}
XSync(globalconf.display, False);
while(XCheckMaskEvent(globalconf.display, EnterWindowMask, &ev));
}
void void
statusbar_refresh() statusbar_refresh()
{ {

View File

@ -29,7 +29,6 @@ void statusbar_draw(Statusbar *);
void statusbar_init(Statusbar *, int); void statusbar_init(Statusbar *, int);
void statusbar_display(Statusbar *); void statusbar_display(Statusbar *);
Position statusbar_get_position_from_str(const char *); Position statusbar_get_position_from_str(const char *);
void statusbar_update_position(Statusbar *);
Uicb uicb_statusbar_toggle; Uicb uicb_statusbar_toggle;