summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorAaron Ash <aaron.ash@gmail.com>2017-04-14 12:14:08 +1000
committerDave Davenport <qball@gmpclient.org>2017-04-14 11:12:21 +0200
commit1bfbc327c249fb9cad463a3949489fa2a55f3416 (patch)
tree8e9f52d8923b91b4df0374d71f2f8221b29bf980 /source
parentd6af6d29fcac2b962f85abbf9e2d069d2a258896 (diff)
Handle null X events without error
Diffstat (limited to 'source')
-rw-r--r--source/rofi.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/rofi.c b/source/rofi.c
index 6f262697..f0c1dde2 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -662,9 +662,14 @@ static gboolean main_loop_x11_event_handler ( xcb_generic_event_t *ev, G_GNUC_UN
{
if ( ev == NULL ) {
int status = xcb_connection_has_error ( xcb->connection );
- fprintf ( stderr, "The XCB connection to X server had a fatal error: %d\n", status );
- g_main_loop_quit ( main_loop );
- return G_SOURCE_REMOVE;
+ if(status > 0) {
+ fprintf ( stderr, "The XCB connection to X server had a fatal error: %d\n", status );
+ g_main_loop_quit ( main_loop );
+ return G_SOURCE_REMOVE;
+ } else {
+ fprintf ( stderr, "Warning: main_loop_x11_event_handler: ev == NULL, status == %d\n", status );
+ return G_SOURCE_CONTINUE;
+ }
}
uint8_t type = ev->response_type & ~0x80;
if ( type == xkb.first_event ) {