From 2aacaa9320ab9849481dbef6e1a50d38361b6032 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 10 Jan 2008 20:53:31 +0100 Subject: [PATCH] stop dropping EnterWindow event and make statusbar_update_position static --- layout.c | 2 -- mouse.c | 1 - statusbar.c | 69 +++++++++++++++++++++++++---------------------------- statusbar.h | 1 - 4 files changed, 33 insertions(+), 40 deletions(-) diff --git a/layout.c b/layout.c index d82861ee..85dd52a2 100644 --- a/layout.c +++ b/layout.c @@ -169,7 +169,6 @@ void restack(int screen) { Client *c, *sel = globalconf.focus->client; - XEvent ev; XWindowChanges wc; Tag **curtags; @@ -202,7 +201,6 @@ restack(int screen) XWarpPointer(globalconf.display, None, sel->win, 0, 0, 0, 0, sel->geometry.width / 2, sel->geometry.height / 2); XSync(globalconf.display, False); - while(XCheckMaskEvent(globalconf.display, EnterWindowMask, &ev)); } void diff --git a/mouse.c b/mouse.c index 83eac08c..0cea7a94 100644 --- a/mouse.c +++ b/mouse.c @@ -177,7 +177,6 @@ uicb_client_resizemouse(int screen, char *arg __attribute__ ((unused))) { case ButtonRelease: XUngrabPointer(globalconf.display, CurrentTime); - while(XCheckMaskEvent(globalconf.display, EnterWindowMask, &ev)); return; case ConfigureRequest: handle_event_configurerequest(&ev); diff --git a/statusbar.c b/statusbar.c index 8460a228..9aaaa790 100644 --- a/statusbar.c +++ b/statusbar.c @@ -30,6 +30,39 @@ 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 statusbar_draw(Statusbar *statusbar) { @@ -206,42 +239,6 @@ statusbar_init(Statusbar *statusbar, int screen) 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 statusbar_refresh() { diff --git a/statusbar.h b/statusbar.h index 0bab9bab..6b194907 100644 --- a/statusbar.h +++ b/statusbar.h @@ -29,7 +29,6 @@ void statusbar_draw(Statusbar *); void statusbar_init(Statusbar *, int); void statusbar_display(Statusbar *); Position statusbar_get_position_from_str(const char *); -void statusbar_update_position(Statusbar *); Uicb uicb_statusbar_toggle;