From e99183c33b734a7914e9934cbbe972fd094f226c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 8 Nov 2017 11:48:39 -0500 Subject: quicklaunch: add support for quicklaunch domains this allows quicklaunch to be used independently of the DISPLAY value --- src/bin/elementary/quicklaunch.c | 11 ++++++++--- src/bin/elementary/run.c | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/bin/elementary/quicklaunch.c b/src/bin/elementary/quicklaunch.c index b7fec56740..6370f6d683 100644 --- a/src/bin/elementary/quicklaunch.c +++ b/src/bin/elementary/quicklaunch.c @@ -181,7 +181,7 @@ main(int argc, char **argv) struct linger lin; char buf[PATH_MAX]; struct sigaction action; - const char *disp; + const char *domain; int ret = 0; if (!eina_init()) @@ -197,7 +197,12 @@ main(int argc, char **argv) _log_dom = EINA_LOG_DOMAIN_GLOBAL; } - if (!(disp = getenv("DISPLAY"))) disp = "unknown"; + if (!(domain = getenv("ELM_QUICKLAUNCH_DOMAIN"))) + { + domain = getenv("WAYLAND_DISPLAY"); + if (!domain) domain = getenv("DISPLAY"); + if (!domain) domain = "unknown"; + } snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i", getuid()); if (stat(buf, &st) < 0) { @@ -208,7 +213,7 @@ main(int argc, char **argv) exit(-1); } } - snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i/%s", getuid(), disp); + snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i/%s", getuid(), domain); unlink(buf); sock = socket(AF_UNIX, SOCK_STREAM, 0); if (sock < 0) diff --git a/src/bin/elementary/run.c b/src/bin/elementary/run.c index a3ad3a4cab..6d547ad16a 100644 --- a/src/bin/elementary/run.c +++ b/src/bin/elementary/run.c @@ -32,7 +32,7 @@ main(int argc, char **argv) struct stat st; char *exe; int we_are_elementary_run = 0; - char *disp; + char *domain; char *cwd; int sargc, slen, envnum; @@ -45,8 +45,13 @@ main(int argc, char **argv) exit(-1); } cwd = strdup(buf); - if (!(disp = getenv("DISPLAY"))) disp = "unknown"; - snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i/%s", getuid(), disp); + if (!(domain = getenv("ELM_QUICKLAUNCH_DOMAIN"))) + { + domain = getenv("WAYLAND_DISPLAY"); + if (!domain) domain = getenv("DISPLAY"); + if (!domain) domain = "unknown"; + } + snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i/%s", getuid(), domain); if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { perror("elementary_quicklaunch: socket(AF_UNIX, SOCK_STREAM, 0)"); -- cgit v1.2.3