summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-06-02 18:23:45 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-06-02 18:23:43 -0400
commit179e89d95512ca0284401c50e0f2e0d751c6c839 (patch)
tree342308073dd8e9c5ba1d6e4df7934b408ee87ac2
parentbc346d367f403f4f8dfeebcf0043126985969b27 (diff)
ecore-audio: unset DISPLAY conditionally before processing pulse events
in some cases, pulse events trigger spawning another pulse instance, and the environment at this time is used to determine whether to attempt an x11 connection fix T2599 @fix
-rw-r--r--src/lib/ecore_audio/ecore_audio_pulse_ml.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/ecore_audio/ecore_audio_pulse_ml.c b/src/lib/ecore_audio/ecore_audio_pulse_ml.c
index 841719b..19b652f 100644
--- a/src/lib/ecore_audio/ecore_audio_pulse_ml.c
+++ b/src/lib/ecore_audio/ecore_audio_pulse_ml.c
@@ -46,6 +46,7 @@ _ecore_io_wrapper(void *data, Ecore_Fd_Handler *handler)
46 pa_io_event_flags_t flags = 0; 46 pa_io_event_flags_t flags = 0;
47 pa_io_event *event = (pa_io_event *)data; 47 pa_io_event *event = (pa_io_event *)data;
48 int fd = 0; 48 int fd = 0;
49 char *disp = NULL;
49 50
50 fd = ecore_main_fd_handler_fd_get(handler); 51 fd = ecore_main_fd_handler_fd_get(handler);
51 if (fd < 0) return ECORE_CALLBACK_RENEW; 52 if (fd < 0) return ECORE_CALLBACK_RENEW;
@@ -70,7 +71,14 @@ _ecore_io_wrapper(void *data, Ecore_Fd_Handler *handler)
70 if (ecore_main_fd_handler_active_get(handler, ECORE_FD_ERROR)) 71 if (ecore_main_fd_handler_active_get(handler, ECORE_FD_ERROR))
71 flags |= PA_IO_EVENT_ERROR; 72 flags |= PA_IO_EVENT_ERROR;
72 73
74 if (getenv("WAYLAND_DISPLAY"))
75 {
76 disp = eina_strdup(getenv("DISPLAY"));
77 unsetenv("DISPLAY");
78 }
73 event->callback(event->mainloop, event, fd, flags, event->userdata); 79 event->callback(event->mainloop, event, fd, flags, event->userdata);
80 if (disp) setenv("DISPLAY", disp, 1);
81 free(disp);
74 82
75 return ECORE_CALLBACK_RENEW; 83 return ECORE_CALLBACK_RENEW;
76} 84}
@@ -142,9 +150,17 @@ Eina_Bool
142_ecore_time_wrapper(void *data) 150_ecore_time_wrapper(void *data)
143{ 151{
144 pa_time_event *event = (pa_time_event *)data; 152 pa_time_event *event = (pa_time_event *)data;
153 char *disp = NULL;
145 154
155 if (getenv("WAYLAND_DISPLAY"))
156 {
157 disp = eina_strdup(getenv("DISPLAY"));
158 unsetenv("DISPLAY");
159 }
146 event->in_event = 1; 160 event->in_event = 1;
147 event->callback(event->mainloop, event, &event->tv, event->userdata); 161 event->callback(event->mainloop, event, &event->tv, event->userdata);
162 if (disp) setenv("DISPLAY", disp, 1);
163 free(disp);
148 event->in_event = 0; 164 event->in_event = 0;
149 event->timer = NULL; 165 event->timer = NULL;
150 if (event->dead) 166 if (event->dead)