summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-07-14 13:31:29 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-07-14 13:31:29 +0100
commit072fd2d741db4c63ff1b42298fb4b38665fb2e30 (patch)
treef11b6466cc422cda0967938dd3748fbb650d70d5 /src
parente278fb3cdae268ca45c997539f15511038af4401 (diff)
e system - isolate stdio of commands we run so they dont pollute
Diffstat (limited to 'src')
-rw-r--r--src/bin/e_comp.c15
-rw-r--r--src/bin/e_comp_canvas.c15
-rw-r--r--src/bin/system/e_system.h2
-rw-r--r--src/bin/system/e_system_main.c13
-rw-r--r--src/bin/system/e_system_power.c8
-rw-r--r--src/bin/system/e_system_storage.c6
6 files changed, 41 insertions, 18 deletions
diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c
index 523c5f24f..b3111f3bf 100644
--- a/src/bin/e_comp.c
+++ b/src/bin/e_comp.c
@@ -379,11 +379,11 @@ _e_comp_cb_update(void)
379 ecore_animator_freeze(e_comp->render_animator); 379 ecore_animator_freeze(e_comp->render_animator);
380 DBG("UPDATE ALL"); 380 DBG("UPDATE ALL");
381 if (e_comp->nocomp) goto nocomp; 381 if (e_comp->nocomp) goto nocomp;
382 if (conf->grab && (!e_comp->grabbed)) 382// if (conf->grab && (!e_comp->grabbed))
383 { 383// {
384 if (e_comp->grab_cb) e_comp->grab_cb(); 384// if (e_comp->grab_cb) e_comp->grab_cb();
385 e_comp->grabbed = 1; 385// e_comp->grabbed = 1;
386 } 386// }
387 e_comp->updating = 1; 387 e_comp->updating = 1;
388 l = e_comp->updates; 388 l = e_comp->updates;
389 e_comp->updates = NULL; 389 e_comp->updates = NULL;
@@ -460,11 +460,6 @@ _e_comp_cb_update(void)
460 // if (!e_comp->nocomp) ecore_evas_manual_render(e_comp->ee); 460 // if (!e_comp->nocomp) ecore_evas_manual_render(e_comp->ee);
461 } 461 }
462 462
463 if (conf->grab && e_comp->grabbed)
464 {
465 if (e_comp->grab_cb) e_comp->grab_cb();
466 e_comp->grabbed = 0;
467 }
468 if (e_comp->updates && (!e_comp->update_job)) 463 if (e_comp->updates && (!e_comp->update_job))
469 ecore_animator_thaw(e_comp->render_animator); 464 ecore_animator_thaw(e_comp->render_animator);
470 /* 465 /*
diff --git a/src/bin/e_comp_canvas.c b/src/bin/e_comp_canvas.c
index e011e858c..5003be5c8 100644
--- a/src/bin/e_comp_canvas.c
+++ b/src/bin/e_comp_canvas.c
@@ -42,6 +42,7 @@ _e_comp_canvas_cb_first_frame(void *data EINA_UNUSED, Evas *e, void *event_info
42static void 42static void
43_e_comp_canvas_render_post(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED) 43_e_comp_canvas_render_post(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *event_info EINA_UNUSED)
44{ 44{
45 E_Comp_Config *conf = e_comp_config_get();
45 E_Client *ec; 46 E_Client *ec;
46 //Evas_Event_Render_Post *ev = event_info; 47 //Evas_Event_Render_Post *ev = event_info;
47 //Eina_List *l; 48 //Eina_List *l;
@@ -65,6 +66,11 @@ _e_comp_canvas_render_post(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *ev
65 UNREFD(ec, 111); 66 UNREFD(ec, 111);
66 e_object_unref(E_OBJECT(ec)); 67 e_object_unref(E_OBJECT(ec));
67 } 68 }
69 if (conf->grab && e_comp->grabbed)
70 {
71 if (e_comp->grab_cb) e_comp->grab_cb();
72 e_comp->grabbed = 0;
73 }
68} 74}
69 75
70/////////////////////////////////// 76///////////////////////////////////
@@ -354,9 +360,16 @@ _e_comp_canvas_prerender(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *even
354{ 360{
355 E_Comp_Cb cb; 361 E_Comp_Cb cb;
356 Eina_List *l; 362 Eina_List *l;
363 E_Comp_Config *conf = e_comp_config_get();
357 364
358 e_comp->rendering = EINA_TRUE; 365 e_comp->rendering = EINA_TRUE;
359 366
367 if (conf->grab && (!e_comp->grabbed))
368 {
369 if (e_comp->grab_cb) e_comp->grab_cb();
370 e_comp->grabbed = 1;
371 }
372
360 EINA_LIST_FOREACH(e_comp->pre_render_cbs, l, cb) 373 EINA_LIST_FOREACH(e_comp->pre_render_cbs, l, cb)
361 cb(); 374 cb();
362} 375}
@@ -404,7 +417,7 @@ e_comp_canvas_init(int w, int h)
404 // ecore_evas_manual_render_set(e_comp->ee, conf->lock_fps); 417 // ecore_evas_manual_render_set(e_comp->ee, conf->lock_fps);
405 ecore_evas_show(e_comp->ee); 418 ecore_evas_show(e_comp->ee);
406 419
407 evas_event_callback_add(e_comp->evas, EVAS_CALLBACK_RENDER_POST, _e_comp_canvas_render_post, NULL); 420 evas_event_callback_add(e_comp->evas, EVAS_CALLBACK_RENDER_FLUSH_POST, _e_comp_canvas_render_post, NULL);
408 421
409 e_comp->ee_win = ecore_evas_window_get(e_comp->ee); 422 e_comp->ee_win = ecore_evas_window_get(e_comp->ee);
410 423
diff --git a/src/bin/system/e_system.h b/src/bin/system/e_system.h
index f2255b803..8ecef6d3d 100644
--- a/src/bin/system/e_system.h
+++ b/src/bin/system/e_system.h
@@ -122,5 +122,7 @@ void e_system_cpufreq_shutdown(void);
122void e_system_ddc_init(void); 122void e_system_ddc_init(void);
123void e_system_ddc_shutdown(void); 123void e_system_ddc_shutdown(void);
124 124
125extern Ecore_Exe *e_system_run(const char *exe);
126
125#endif 127#endif
126 128
diff --git a/src/bin/system/e_system_main.c b/src/bin/system/e_system_main.c
index d18a80f39..23a5f6f77 100644
--- a/src/bin/system/e_system_main.c
+++ b/src/bin/system/e_system_main.c
@@ -203,3 +203,16 @@ main(int argc EINA_UNUSED, const char **argv EINA_UNUSED)
203 eina_shutdown(); 203 eina_shutdown();
204 return 0; 204 return 0;
205} 205}
206
207Ecore_Exe *
208e_system_run(const char *cmd)
209{
210 Ecore_Exe_Flags flags = ECORE_EXE_NONE;
211#if (ECORE_VERSION_MAJOR >= 1) && (ECORE_VERSION_MINOR >= 21)
212 flags |= ECORE_EXE_ISOLATE_IO;
213#else
214 flags |= 1024; // isolate_io is bit 10 .... it will be ignored if
215 // efl doesn't do it, so harmless
216#endif
217 return ecore_exe_pipe_run(cmd, flags, NULL);
218}
diff --git a/src/bin/system/e_system_power.c b/src/bin/system/e_system_power.c
index 6643a3133..9b44bc4db 100644
--- a/src/bin/system/e_system_power.c
+++ b/src/bin/system/e_system_power.c
@@ -8,25 +8,25 @@ char *_cmd_hibernate = NULL;
8static void 8static void
9_cb_power_halt(void *data EINA_UNUSED, const char *params EINA_UNUSED) 9_cb_power_halt(void *data EINA_UNUSED, const char *params EINA_UNUSED)
10{ 10{
11 if (_cmd_halt) ecore_exe_run(_cmd_halt, NULL); 11 if (_cmd_halt) e_system_run(_cmd_halt);
12} 12}
13 13
14static void 14static void
15_cb_power_reboot(void *data EINA_UNUSED, const char *params EINA_UNUSED) 15_cb_power_reboot(void *data EINA_UNUSED, const char *params EINA_UNUSED)
16{ 16{
17 if (_cmd_reboot) ecore_exe_run(_cmd_reboot, NULL); 17 if (_cmd_reboot) e_system_run(_cmd_reboot);
18} 18}
19 19
20static void 20static void
21_cb_power_suspend(void *data EINA_UNUSED, const char *params EINA_UNUSED) 21_cb_power_suspend(void *data EINA_UNUSED, const char *params EINA_UNUSED)
22{ 22{
23 if (_cmd_suspend) ecore_exe_run(_cmd_suspend, NULL); 23 if (_cmd_suspend) e_system_run(_cmd_suspend);
24} 24}
25 25
26static void 26static void
27_cb_power_hibernate(void *data EINA_UNUSED, const char *params EINA_UNUSED) 27_cb_power_hibernate(void *data EINA_UNUSED, const char *params EINA_UNUSED)
28{ 28{
29 if (_cmd_hibernate) ecore_exe_run(_cmd_hibernate, NULL); 29 if (_cmd_hibernate) e_system_run(_cmd_hibernate);
30} 30}
31 31
32static void 32static void
diff --git a/src/bin/system/e_system_storage.c b/src/bin/system/e_system_storage.c
index c696f0e8c..ddbfb22cb 100644
--- a/src/bin/system/e_system_storage.c
+++ b/src/bin/system/e_system_storage.c
@@ -328,19 +328,19 @@ _store_action_do(Action *a)
328 { 328 {
329 if (a->cmd2) 329 if (a->cmd2)
330 { 330 {
331 a->exe = ecore_exe_run(a->cmd2, NULL); 331 a->exe = e_system_run(a->cmd2);
332 free(a->cmd2); 332 free(a->cmd2);
333 a->cmd2 = NULL; 333 a->cmd2 = NULL;
334 } 334 }
335 else if (a->cmd1) 335 else if (a->cmd1)
336 { 336 {
337 a->exe = ecore_exe_run(a->cmd1, NULL); 337 a->exe = e_system_run(a->cmd1);
338 free(a->cmd1); 338 free(a->cmd1);
339 a->cmd1 = NULL; 339 a->cmd1 = NULL;
340 } 340 }
341 else 341 else
342 { 342 {
343 a->exe = ecore_exe_run(a->cmd, NULL); 343 a->exe = e_system_run(a->cmd);
344 free(a->cmd); 344 free(a->cmd);
345 a->cmd = NULL; 345 a->cmd = NULL;
346 } 346 }