[PATCH weston] xwm: flush xcb connection only when we processed some event

Marek Chalupa mchqwerty at gmail.com
Thu May 14 03:04:05 PDT 2015


And also write out a warning when we got some event that
we cannot handle.

Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
---
 xwayland/window-manager.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index 039f0cd..b1fd12d 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -1930,13 +1930,17 @@ weston_wm_handle_event(int fd, uint32_t mask, void *data)
 		case XCB_CLIENT_MESSAGE:
 			weston_wm_handle_client_message(wm, event);
 			break;
+		default:
+			fprintf(stderr, "WARNING: xwm unhandled event: %p %d\n",
+				event, event ? EVENT_TYPE(event) :-1);
 		}
 
 		free(event);
 		count++;
 	}
 
-	xcb_flush(wm->conn);
+	if (count != 0)
+		xcb_flush(wm->conn);
 
 	return count;
 }
-- 
2.1.0



More information about the wayland-devel mailing list