summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-11-08 11:48:39 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-11-08 11:48:39 -0500
commite99183c33b734a7914e9934cbbe972fd094f226c (patch)
treea83b23db07135aa2f65ec34d4e68501524cd9b6a
parent70ee11af84bf81a16eefdf577ce4e4ecb62dcdef (diff)
quicklaunch: add support for quicklaunch domains
this allows quicklaunch to be used independently of the DISPLAY value
-rw-r--r--src/bin/elementary/quicklaunch.c11
-rw-r--r--src/bin/elementary/run.c11
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)
181 struct linger lin; 181 struct linger lin;
182 char buf[PATH_MAX]; 182 char buf[PATH_MAX];
183 struct sigaction action; 183 struct sigaction action;
184 const char *disp; 184 const char *domain;
185 int ret = 0; 185 int ret = 0;
186 186
187 if (!eina_init()) 187 if (!eina_init())
@@ -197,7 +197,12 @@ main(int argc, char **argv)
197 _log_dom = EINA_LOG_DOMAIN_GLOBAL; 197 _log_dom = EINA_LOG_DOMAIN_GLOBAL;
198 } 198 }
199 199
200 if (!(disp = getenv("DISPLAY"))) disp = "unknown"; 200 if (!(domain = getenv("ELM_QUICKLAUNCH_DOMAIN")))
201 {
202 domain = getenv("WAYLAND_DISPLAY");
203 if (!domain) domain = getenv("DISPLAY");
204 if (!domain) domain = "unknown";
205 }
201 snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i", getuid()); 206 snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i", getuid());
202 if (stat(buf, &st) < 0) 207 if (stat(buf, &st) < 0)
203 { 208 {
@@ -208,7 +213,7 @@ main(int argc, char **argv)
208 exit(-1); 213 exit(-1);
209 } 214 }
210 } 215 }
211 snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i/%s", getuid(), disp); 216 snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i/%s", getuid(), domain);
212 unlink(buf); 217 unlink(buf);
213 sock = socket(AF_UNIX, SOCK_STREAM, 0); 218 sock = socket(AF_UNIX, SOCK_STREAM, 0);
214 if (sock < 0) 219 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)
32 struct stat st; 32 struct stat st;
33 char *exe; 33 char *exe;
34 int we_are_elementary_run = 0; 34 int we_are_elementary_run = 0;
35 char *disp; 35 char *domain;
36 char *cwd; 36 char *cwd;
37 37
38 int sargc, slen, envnum; 38 int sargc, slen, envnum;
@@ -45,8 +45,13 @@ main(int argc, char **argv)
45 exit(-1); 45 exit(-1);
46 } 46 }
47 cwd = strdup(buf); 47 cwd = strdup(buf);
48 if (!(disp = getenv("DISPLAY"))) disp = "unknown"; 48 if (!(domain = getenv("ELM_QUICKLAUNCH_DOMAIN")))
49 snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i/%s", getuid(), disp); 49 {
50 domain = getenv("WAYLAND_DISPLAY");
51 if (!domain) domain = getenv("DISPLAY");
52 if (!domain) domain = "unknown";
53 }
54 snprintf(buf, sizeof(buf), "/tmp/elm-ql-%i/%s", getuid(), domain);
50 if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) 55 if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
51 { 56 {
52 perror("elementary_quicklaunch: socket(AF_UNIX, SOCK_STREAM, 0)"); 57 perror("elementary_quicklaunch: socket(AF_UNIX, SOCK_STREAM, 0)");