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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-09-23 10:51:24 +02:00
parent ab135fa7c9
commit 93ed7fd46f
1 changed files with 8 additions and 2 deletions

View File

@ -1138,7 +1138,7 @@ client_border_refresh(void)
static void static void
client_geometry_refresh(void) client_geometry_refresh(void)
{ {
client_ignore_enterleave_events(); bool ignored_enterleave = false;
foreach(_c, globalconf.clients) foreach(_c, globalconf.clients)
{ {
client_t *c = *_c; client_t *c = *_c;
@ -1164,6 +1164,11 @@ client_geometry_refresh(void)
&& AREA_EQUAL(real_geometry, c->x11_client_geometry)) && AREA_EQUAL(real_geometry, c->x11_client_geometry))
continue; continue;
if (!ignored_enterleave) {
client_ignore_enterleave_events();
ignored_enterleave = true;
}
xcb_configure_window(globalconf.connection, c->frame_window, xcb_configure_window(globalconf.connection, c->frame_window,
XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, 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 }); (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... */ /* ICCCM 4.2.3 says something else, but Java always needs this... */
client_send_configure(c); client_send_configure(c);
} }
client_restore_enterleave_events(); if (ignored_enterleave)
client_restore_enterleave_events();
} }
void void