xwm: flush xcb connection only when we processed some event
authorMarek Chalupa <mchqwerty@gmail.com>
Wed, 12 Aug 2015 07:55:12 +0000 (09:55 +0200)
committerBryce Harrington <bryce@osg.samsung.com>
Wed, 23 Sep 2015 01:35:01 +0000 (18:35 -0700)
xwayland source is checked, so it dispatches twice on any event.
If the other turn has no events to dispatch, we flush the connection
redundantly

v2. do not flood logs with 'unhandled event' messages

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
xwayland/window-manager.c

index f9544d88e488765e2c2fcbd0de0de50307e8e09b..db6b4379f6a677877b3d8888d8e817e816459df4 100644 (file)
@@ -1979,7 +1979,8 @@ weston_wm_handle_event(int fd, uint32_t mask, void *data)
                count++;
        }
 
-       xcb_flush(wm->conn);
+       if (count != 0)
+               xcb_flush(wm->conn);
 
        return count;
 }