use separate handler for x11 fatal errors when using xwayland
authorMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 24 Nov 2015 20:34:42 +0000 (15:34 -0500)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Tue, 24 Nov 2015 20:34:42 +0000 (15:34 -0500)
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
src/modules/xwayland/e_mod_main.c

index 2fedda4..fde492e 100644 (file)
@@ -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())
      {
index e73e254..eed026d 100644 (file)
@@ -253,6 +253,14 @@ fail:
 }
 
 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)
 {
    if (!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