summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-09-26 11:22:44 -0400
committerChristopher Michael <cp.michael@samsung.com>2019-09-26 11:22:44 -0400
commitfddc27ed4041d792f4933110d7e6c14f1cac2bca (patch)
treebe15944b2d5a405847dd5b15bb3fb793c7aac304
parent9d16a44334f845d8053602c30d28bd4cb600046d (diff)
ecore-evas/x: detect and track wm existence, apply visibility correctly
Summary: this attempts to monitor the _NET_SUPPORTING_WM_CHECK atom to verify whether a wm exists, and bypasses waiting for a configure event from a nonexistent wm if the screen is not currently managed fix T7838 Depends on D10014 Reviewers: devilhorns Reviewed By: devilhorns Subscribers: devilhorns, thierry1970, cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7838 Differential Revision: https://phab.enlightenment.org/D9900
-rw-r--r--src/modules/ecore_evas/engines/x/ecore_evas_x.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index 590831760e..97e5fb2d10 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -69,6 +69,8 @@ static const char *interface_gl_x11_name = "gl_x11";
69#endif 69#endif
70static const int interface_gl_x11_version = 1; 70static const int interface_gl_x11_version = 1;
71 71
72static Eina_Bool wm_exists;
73
72typedef struct _Ecore_Evas_Engine_Data_X11 Ecore_Evas_Engine_Data_X11; 74typedef struct _Ecore_Evas_Engine_Data_X11 Ecore_Evas_Engine_Data_X11;
73 75
74struct _Ecore_Evas_Engine_Data_X11 { 76struct _Ecore_Evas_Engine_Data_X11 {
@@ -809,6 +811,11 @@ _ecore_evas_x_event_property_change(void *data EINA_UNUSED, int type EINA_UNUSED
809 int state_change = 0; 811 int state_change = 0;
810 812
811 e = event; 813 e = event;
814 if (e->win == ecore_x_window_root_first_get())
815 {
816 if (e->atom == ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK)
817 wm_exists = !ecore_x_window_prop_window_get(ecore_x_window_root_first_get(), ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK, NULL, 0);
818 }
812 ee = ecore_event_window_match(e->win); 819 ee = ecore_event_window_match(e->win);
813 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */ 820 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */
814 edata = ee->engine.data; 821 edata = ee->engine.data;
@@ -1000,7 +1007,7 @@ _ecore_evas_x_event_visibility_change(void *data EINA_UNUSED, int type EINA_UNUS
1000 if (e->fully_obscured) 1007 if (e->fully_obscured)
1001 { 1008 {
1002 /* FIXME: round trip */ 1009 /* FIXME: round trip */
1003 if (!ecore_x_screen_is_composited(edata->screen_num)) 1010 if ((!wm_exists) || (!ecore_x_screen_is_composited(edata->screen_num)))
1004 ee->draw_block = !edata->configured; 1011 ee->draw_block = !edata->configured;
1005 } 1012 }
1006 else if (ee->draw_block) 1013 else if (ee->draw_block)
@@ -1543,14 +1550,14 @@ _ecore_evas_x_event_window_configure(void *data EINA_UNUSED, int type EINA_UNUSE
1543 if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */ 1550 if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
1544 edata = ee->engine.data; 1551 edata = ee->engine.data;
1545 if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON; 1552 if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
1546 if ((e->from_wm) || (ee->prop.override)) 1553 if ((!wm_exists) || (e->from_wm) || (ee->prop.override))
1547 { 1554 {
1548 if (!edata->configured) 1555 if (!edata->configured)
1549 { 1556 {
1550 if (edata->fully_obscured) 1557 if (edata->fully_obscured)
1551 { 1558 {
1552 /* FIXME: round trip */ 1559 /* FIXME: round trip */
1553 if (!ecore_x_screen_is_composited(edata->screen_num)) 1560 if ((!wm_exists) || (!ecore_x_screen_is_composited(edata->screen_num)))
1554 ee->draw_block = EINA_FALSE; 1561 ee->draw_block = EINA_FALSE;
1555 } 1562 }
1556 else 1563 else
@@ -1902,11 +1909,16 @@ _ecore_evas_x_layer_update(Ecore_Evas *ee)
1902 /* FIXME: Set gnome layer */ 1909 /* FIXME: Set gnome layer */
1903} 1910}
1904 1911
1912EAPI void ecore_x_window_root_properties_select(void);
1913
1905static int 1914static int
1906_ecore_evas_x_init(void) 1915_ecore_evas_x_init(void)
1907{ 1916{
1908 _ecore_evas_init_count++; 1917 _ecore_evas_init_count++;
1909 if (_ecore_evas_init_count > 1) return _ecore_evas_init_count; 1918 if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
1919
1920 ecore_x_window_root_properties_select();
1921 wm_exists = !ecore_x_window_prop_window_get(ecore_x_window_root_first_get(), ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK, NULL, 0);
1910 ecore_evas_event_handlers[0] = 1922 ecore_evas_event_handlers[0] =
1911 ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN, 1923 ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN,
1912 _ecore_evas_x_event_mouse_in, NULL); 1924 _ecore_evas_x_event_mouse_in, NULL);
@@ -4100,6 +4112,7 @@ ecore_evas_software_x11_new_internal(const char *disp_name, Ecore_X_Window paren
4100 4112
4101 ee->engine.func->fn_render = _ecore_evas_x_render; 4113 ee->engine.func->fn_render = _ecore_evas_x_render;
4102 ee->draw_block = EINA_TRUE; 4114 ee->draw_block = EINA_TRUE;
4115 if (!wm_exists) edata->configured = 1;
4103 4116
4104 ecore_x_input_multi_select(ee->prop.window); 4117 ecore_x_input_multi_select(ee->prop.window);
4105 ecore_evas_done(ee, EINA_FALSE); 4118 ecore_evas_done(ee, EINA_FALSE);
@@ -4314,6 +4327,7 @@ ecore_evas_software_x11_pixmap_new_internal(const char *disp_name, Ecore_X_Windo
4314 _ecore_evas_register(ee); 4327 _ecore_evas_register(ee);
4315 4328
4316 ee->draw_block = EINA_FALSE; 4329 ee->draw_block = EINA_FALSE;
4330 if (!wm_exists) edata->configured = 1;
4317 4331
4318 /* ecore_x_input_multi_select(ee->prop.window); */ 4332 /* ecore_x_input_multi_select(ee->prop.window); */
4319 /* ecore_event_window_register(ee->prop.window, ee, ee->evas, */ 4333 /* ecore_event_window_register(ee->prop.window, ee, ee->evas, */
@@ -4533,6 +4547,7 @@ ecore_evas_gl_x11_options_new_internal(const char *disp_name, Ecore_X_Window par
4533 _ecore_evas_x_aux_hints_update(ee); 4547 _ecore_evas_x_aux_hints_update(ee);
4534 4548
4535 ee->draw_block = 1; 4549 ee->draw_block = 1;
4550 if (!wm_exists) edata->configured = 1;
4536 4551
4537 ee->engine.func->fn_render = _ecore_evas_x_render; 4552 ee->engine.func->fn_render = _ecore_evas_x_render;
4538 ecore_x_input_multi_select(ee->prop.window); 4553 ecore_x_input_multi_select(ee->prop.window);
@@ -4721,6 +4736,7 @@ ecore_evas_gl_x11_pixmap_new_internal(const char *disp_name, Ecore_X_Window pare
4721 _ecore_evas_register(ee); 4736 _ecore_evas_register(ee);
4722 4737
4723 ee->draw_block = EINA_TRUE; 4738 ee->draw_block = EINA_TRUE;
4739 if (!wm_exists) edata->configured = 1;
4724 4740
4725 /* ecore_x_input_multi_select(ee->prop.window); */ 4741 /* ecore_x_input_multi_select(ee->prop.window); */
4726 /* ecore_event_window_register(ee->prop.window, ee, ee->evas, */ 4742 /* ecore_event_window_register(ee->prop.window, ee, ee->evas, */