From 96035d4d5de39174ac057c32087a9bdfa5851962 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 24 Nov 2015 15:34:42 -0500 Subject: [PATCH] use separate handler for x11 fatal errors when using xwayland a fatal error with xwayland is not a fatal error for the compositor, so this should not result in a dead session --- src/bin/e_comp_x.c | 3 ++- src/modules/xwayland/e_mod_main.c | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c index 2fedda4c0..fde492efe 100644 --- a/src/bin/e_comp_x.c +++ b/src/bin/e_comp_x.c @@ -5333,7 +5333,8 @@ e_comp_x_init(void) return EINA_FALSE; } - ecore_x_io_error_handler_set(_e_main_cb_x_fatal, NULL); + if (e_comp->comp_type == E_PIXMAP_TYPE_X) + ecore_x_io_error_handler_set(_e_main_cb_x_fatal, NULL); if (!ecore_x_composite_query()) { diff --git a/src/modules/xwayland/e_mod_main.c b/src/modules/xwayland/e_mod_main.c index e73e254b4..eed026d5f 100644 --- a/src/modules/xwayland/e_mod_main.c +++ b/src/modules/xwayland/e_mod_main.c @@ -252,6 +252,14 @@ fail: return ECORE_CALLBACK_RENEW; } +static void +xwayland_fatal(void *d EINA_UNUSED) +{ + /* on xwayland fatal, attempt to restart it */ + e_modapi_shutdown(NULL); + e_modapi_init(NULL); +} + static void xnotify(void *d EINA_UNUSED, Ecore_Thread *eth EINA_UNUSED, void *disp) { @@ -263,6 +271,7 @@ xnotify(void *d EINA_UNUSED, Ecore_Thread *eth EINA_UNUSED, void *disp) assert(ecore_x_init_from_display(disp)); e_comp_x_init(); dnd_init(); + ecore_x_io_error_handler_set(xwayland_fatal, NULL); } static void