]> git.sur5r.net Git - i3/i3/commitdiff
Only react on the last Expose event in a series of events. (#2636)
authorIngo Bürk <admin@airblader.de>
Fri, 13 Jan 2017 17:34:58 +0000 (18:34 +0100)
committerMichael Stapelberg <stapelberg@users.noreply.github.com>
Fri, 13 Jan 2017 17:34:58 +0000 (09:34 -0800)
Thanks to @psychon for pointing this out during the review of PR #2624.
This commit extends this change to all other occurences of Expose events
within i3.

i3-config-wizard/main.c
i3-input/main.c
i3-nagbar/main.c
i3bar/src/xcb.c
src/handlers.c
src/restore_layout.c

index 9e851c06f3f1b73e0ca7f6453b93e62034f0e320..8eec941c758144f41e216d7ecdbf498a34677c63 100644 (file)
@@ -966,7 +966,10 @@ int main(int argc, char *argv[]) {
                 break;
 
             case XCB_EXPOSE:
-                handle_expose();
+                if (((xcb_expose_event_t *)event)->count == 0) {
+                    handle_expose();
+                }
+
                 break;
         }
 
index 0f07c845dfd6dbd1e2607945c102ad1df4c55b3c..6d1e337811102b041376e0a997172f20c34e8778 100644 (file)
@@ -525,7 +525,10 @@ int main(int argc, char *argv[]) {
                 break;
 
             case XCB_EXPOSE:
-                handle_expose(NULL, conn, (xcb_expose_event_t *)event);
+                if (((xcb_expose_event_t *)event)->count == 0) {
+                    handle_expose(NULL, conn, (xcb_expose_event_t *)event);
+                }
+
                 break;
         }
 
index b9f27a87fabc928f9d8e323a46f41427c9aa6f92..eb25e9cb0bd3c77b726621ba180b3fd2aa771bd4 100644 (file)
@@ -596,7 +596,10 @@ int main(int argc, char *argv[]) {
 
         switch (type) {
             case XCB_EXPOSE:
-                handle_expose(conn, (xcb_expose_event_t *)event);
+                if (((xcb_expose_event_t *)event)->count == 0) {
+                    handle_expose(conn, (xcb_expose_event_t *)event);
+                }
+
                 break;
 
             case XCB_BUTTON_PRESS:
index d3bfca69dc6aea6ba1dffc7f5630a3940292fa00..edef9b7e2dd1edbae31b4376c896f4c2edeedc8f 100644 (file)
@@ -1149,8 +1149,11 @@ void xcb_chk_cb(struct ev_loop *loop, ev_check *watcher, int revents) {
                 handle_visibility_notify((xcb_visibility_notify_event_t *)event);
                 break;
             case XCB_EXPOSE:
-                /* Expose-events happen, when the window needs to be redrawn */
-                redraw_bars();
+                if (((xcb_expose_event_t *)event)->count == 0) {
+                    /* Expose-events happen, when the window needs to be redrawn */
+                    redraw_bars();
+                }
+
                 break;
             case XCB_BUTTON_PRESS:
                 /* Button press events are mouse buttons clicked on one of our bars */
index 6d7be46525770407f8837150d487971b0006e41b..315688c440768cae2c05caa3ff46c45c3bb2c993 100644 (file)
@@ -1511,7 +1511,10 @@ void handle_event(int type, xcb_generic_event_t *event) {
             break;
 
         case XCB_EXPOSE:
-            handle_expose_event((xcb_expose_event_t *)event);
+            if (((xcb_expose_event_t *)event)->count == 0) {
+                handle_expose_event((xcb_expose_event_t *)event);
+            }
+
             break;
 
         case XCB_MOTION_NOTIFY:
index d48e5c6ef6197496cd1b8be54bacc19b717622d6..9edf4b11e1480a8bd762af57f103d3869e07615b 100644 (file)
@@ -360,7 +360,10 @@ static void configure_notify(xcb_configure_notify_event_t *event) {
 static void restore_handle_event(int type, xcb_generic_event_t *event) {
     switch (type) {
         case XCB_EXPOSE:
-            expose_event((xcb_expose_event_t *)event);
+            if (((xcb_expose_event_t *)event)->count == 0) {
+                expose_event((xcb_expose_event_t *)event);
+            }
+
             break;
         case XCB_CONFIGURE_NOTIFY:
             configure_notify((xcb_configure_notify_event_t *)event);