pop an error dialog when trying to load xwayland module under x11
authorMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 2 Jul 2015 18:26:40 +0000 (14:26 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 2 Jul 2015 18:28:07 +0000 (14:28 -0400)
this is impossible and will never be possible; ecore-x can only manage
a single x11 connection at any time, and so it will never be possible to both
manage the x11 compositor canvas on one xserver and manage xwayland clients
on a separate server

invalidates T2537

src/modules/xwayland/e_mod_main.c

index c5b982d..5b6a42f 100644 (file)
@@ -288,6 +288,13 @@ setup_lock(void)
    return EINA_FALSE;
 }
 
+static Eina_Bool
+error_dialog()
+{
+   e_util_dialog_internal(_("Error"), _("Cannot launch XWayland from X11 display."));
+   return EINA_FALSE;
+}
+
 /* module functions */
 E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "XWayland" };
 
@@ -299,6 +306,12 @@ e_modapi_init(E_Module *m)
    /* make sure it's a wayland compositor */
    if (e_comp->comp_type != E_PIXMAP_TYPE_WL) return NULL;
 
+   if (getenv("DISPLAY"))
+     {
+        ecore_timer_add(1.0, error_dialog, NULL);
+        return NULL;
+     }
+
    DBG("LOAD XWAYLAND MODULE");
 
    /* alloc space for server struct */