From 93ed7fd46f81fa5017877f534180e8ca2ca85f5d Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 23 Sep 2016 10:51:24 +0200 Subject: [PATCH] client_geometry_refresh(): Ignore enter/leave events less This commit makes the function only call client_ignore_enterleave_events() when it actually has to. Since we expect that most of the time, no client's geometry is changed, this means that most of the time this function is not called. Fixes: https://github.com/awesomeWM/awesome/issues/1107 Signed-off-by: Uli Schlachter --- objects/client.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/objects/client.c b/objects/client.c index e561aae2b..bdb372662 100644 --- a/objects/client.c +++ b/objects/client.c @@ -1138,7 +1138,7 @@ client_border_refresh(void) static void client_geometry_refresh(void) { - client_ignore_enterleave_events(); + bool ignored_enterleave = false; foreach(_c, globalconf.clients) { client_t *c = *_c; @@ -1164,6 +1164,11 @@ client_geometry_refresh(void) && AREA_EQUAL(real_geometry, c->x11_client_geometry)) continue; + if (!ignored_enterleave) { + client_ignore_enterleave_events(); + ignored_enterleave = true; + } + xcb_configure_window(globalconf.connection, c->frame_window, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, (uint32_t[]) { geometry.x, geometry.y, geometry.width, geometry.height }); @@ -1177,7 +1182,8 @@ client_geometry_refresh(void) /* ICCCM 4.2.3 says something else, but Java always needs this... */ client_send_configure(c); } - client_restore_enterleave_events(); + if (ignored_enterleave) + client_restore_enterleave_events(); } void