summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@open.eurogiciel.org>2013-12-12 16:36:53 +0100
committerEduardo Lima (Etrunko) <eduardo.lima@intel.com>2013-12-19 17:49:01 -0200
commitb94070c08a354d8aff3788688d4c6384461633a9 (patch)
tree9d938730de97cf2da30e77fc0ebea24064d65717
parent3d48c8e7c5b43bb2079cfeed636dbc6dfde13e85 (diff)
Fix window hide/show() using withdrawn_set()devs/etrunko/tizen
Modified to make current version of IVI-Shell work. Bug-Tizen: https://bugs.tizen.org/jira/browse/TIVI-2048 Bug-Upstream: https://phab.enlightenment.org/T155 Co-Authored-by: Rafael Antognolli <rafael.antognolli@intel.com> Change-Id: I2dbd03a4b2362df4535f7705f1afffec6928d8db Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
-rw-r--r--src/lib/ecore_evas/ecore_evas_wayland_egl.c51
-rw-r--r--src/lib/ecore_evas/ecore_evas_wayland_shm.c38
2 files changed, 75 insertions, 14 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_wayland_egl.c b/src/lib/ecore_evas/ecore_evas_wayland_egl.c
index 2b316758..1a2ca6a5 100644
--- a/src/lib/ecore_evas/ecore_evas_wayland_egl.c
+++ b/src/lib/ecore_evas/ecore_evas_wayland_egl.c
@@ -95,12 +95,14 @@ static void _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer);
95static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify); 95static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify);
96static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max); 96static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max);
97static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full); 97static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full);
98static void _ecore_evas_wl_withdrawn_set(Ecore_Evas *ee, int val);
98static void _ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore); 99static void _ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore);
99static void _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha); 100static void _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha);
100static void _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent); 101static void _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent);
101static int _ecore_evas_wl_render(Ecore_Evas *ee); 102static int _ecore_evas_wl_render(Ecore_Evas *ee);
102static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h); 103static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h);
103static void _ecore_evas_wl_screen_dpi_get(const Ecore_Evas *ee __UNUSED__, int *xdpi, int *ydpi); 104static void _ecore_evas_wl_screen_dpi_get(const Ecore_Evas *ee __UNUSED__, int *xdpi, int *ydpi);
105static void _ecore_evas_wl_frame_callback_clean(Ecore_Evas *ee);
104static Eina_Bool _ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event); 106static Eina_Bool _ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
105static Eina_Bool _ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event); 107static Eina_Bool _ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event);
106static Eina_Bool _ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event); 108static Eina_Bool _ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event);
@@ -166,7 +168,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
166 _ecore_evas_wl_maximized_set, 168 _ecore_evas_wl_maximized_set,
167 _ecore_evas_wl_fullscreen_set, 169 _ecore_evas_wl_fullscreen_set,
168 NULL, // func avoid_damage set 170 NULL, // func avoid_damage set
169 NULL, // func withdrawn set 171 _ecore_evas_wl_withdrawn_set,
170 NULL, // func sticky set 172 NULL, // func sticky set
171 _ecore_evas_wl_ignore_events_set, 173 _ecore_evas_wl_ignore_events_set,
172 _ecore_evas_wl_alpha_set, 174 _ecore_evas_wl_alpha_set,
@@ -587,6 +589,7 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
587 if ((ee->prop.title) && (ee->engine.wl.win->shell_surface)) 589 if ((ee->prop.title) && (ee->engine.wl.win->shell_surface))
588 wl_shell_surface_set_title(ee->engine.wl.win->shell_surface, 590 wl_shell_surface_set_title(ee->engine.wl.win->shell_surface,
589 ee->prop.title); 591 ee->prop.title);
592
590 } 593 }
591 594
592 if (ee->engine.wl.frame) 595 if (ee->engine.wl.frame)
@@ -611,6 +614,9 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
611 /* printf("Failed to get a Surface from Ecore_Wl\n"); */ 614 /* printf("Failed to get a Surface from Ecore_Wl\n"); */
612 } 615 }
613 616
617 /* force an update to push events, especially useful for wayland_egl */
618 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
619
614 ee->visible = 1; 620 ee->visible = 1;
615 if (ee->func.fn_show) ee->func.fn_show(ee); 621 if (ee->func.fn_show) ee->func.fn_show(ee);
616} 622}
@@ -636,6 +642,7 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
636 642
637 ee->visible = 0; 643 ee->visible = 0;
638 ee->should_be_visible = 0; 644 ee->should_be_visible = 0;
645 _ecore_evas_wl_frame_callback_clean (ee);
639 646
640 if (ee->func.fn_hide) ee->func.fn_hide(ee); 647 if (ee->func.fn_hide) ee->func.fn_hide(ee);
641} 648}
@@ -791,6 +798,17 @@ _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full)
791 ee->func.fn_state_change(ee); 798 ee->func.fn_state_change(ee);
792} 799}
793 800
801static void
802_ecore_evas_wl_withdrawn_set(Ecore_Evas *ee, int val)
803{
804 LOGFN(__FILE__, __LINE__, __FUNCTION__);
805
806 if (val)
807 ecore_evas_hide(ee);
808 else
809 ecore_evas_show(ee);
810}
811
794static void 812static void
795_ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore) 813_ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore)
796{ 814{
@@ -852,19 +870,33 @@ static const struct wl_callback_listener frame_listener = {
852}; 870};
853 871
854static void 872static void
855_ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback, uint32_t time __UNUSED__) 873_ecore_evas_wl_frame_callback_clean(Ecore_Evas *ee)
856{ 874{
857 Ecore_Evas *ee = data;
858 Ecore_Wl_Window *win = ee->engine.wl.win; 875 Ecore_Wl_Window *win = ee->engine.wl.win;
859 876
877 if (!win->frame_pending)
878 return;
879 wl_callback_destroy(win->frame_callback);
860 win->frame_callback = NULL; 880 win->frame_callback = NULL;
861 win->frame_pending = EINA_FALSE; 881 win->frame_pending = EINA_FALSE;
862 wl_callback_destroy(callback); 882}
863 883
864 if (win->surface) 884static void
885_ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback __UNUSED__, uint32_t time __UNUSED__)
886{
887 Ecore_Evas *ee = data;
888 Ecore_Wl_Window *win = NULL;
889
890 if (!ee) return;
891
892 _ecore_evas_wl_frame_callback_clean(ee);
893
894 if (!(win = ee->engine.wl.win)) return;
895
896 if (ecore_wl_window_surface_get(win))
865 { 897 {
866 win->frame_callback = 898 win->frame_callback =
867 wl_surface_frame(win->surface); 899 wl_surface_frame(ecore_wl_window_surface_get(win));
868 wl_callback_add_listener(win->frame_callback, 900 wl_callback_add_listener(win->frame_callback,
869 &frame_listener, ee); 901 &frame_listener, ee);
870 } 902 }
@@ -877,7 +909,10 @@ _ecore_evas_wl_render(Ecore_Evas *ee)
877 909
878 if (!ee) return 0; 910 if (!ee) return 0;
879 if (!ee->visible) 911 if (!ee->visible)
880 evas_norender(ee->evas); 912 {
913 evas_norender(ee->evas);
914 return 0;
915 }
881 else 916 else
882 { 917 {
883 Eina_List *ll = NULL, *updates = NULL; 918 Eina_List *ll = NULL, *updates = NULL;
diff --git a/src/lib/ecore_evas/ecore_evas_wayland_shm.c b/src/lib/ecore_evas/ecore_evas_wayland_shm.c
index 65ef1cae..3dfa4fe9 100644
--- a/src/lib/ecore_evas/ecore_evas_wayland_shm.c
+++ b/src/lib/ecore_evas/ecore_evas_wayland_shm.c
@@ -101,6 +101,7 @@ static void _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer);
101static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify); 101static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify);
102static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max); 102static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max);
103static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full); 103static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full);
104static void _ecore_evas_wl_withdrawn_set(Ecore_Evas *ee, int val);
104static void _ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore); 105static void _ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore);
105static void _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha); 106static void _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha);
106static void _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent); 107static void _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent);
@@ -111,6 +112,7 @@ static void _ecore_evas_wl_ensure_pool_size(Ecore_Evas *ee, int w, int h);
111static struct wl_shm_pool *_ecore_evas_wl_shm_pool_create(int size, void **data); 112static struct wl_shm_pool *_ecore_evas_wl_shm_pool_create(int size, void **data);
112 113
113static void _ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback, uint32_t tm EINA_UNUSED); 114static void _ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback, uint32_t tm EINA_UNUSED);
115static void _ecore_evas_wl_frame_callback_clean(Ecore_Evas *ee);
114 116
115static void _ecore_evas_wl_buffer_new(Ecore_Evas *ee, struct wl_shm_pool *pool); 117static void _ecore_evas_wl_buffer_new(Ecore_Evas *ee, struct wl_shm_pool *pool);
116 118
@@ -184,7 +186,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
184 _ecore_evas_wl_maximized_set, 186 _ecore_evas_wl_maximized_set,
185 _ecore_evas_wl_fullscreen_set, 187 _ecore_evas_wl_fullscreen_set,
186 NULL, // func avoid_damage set 188 NULL, // func avoid_damage set
187 NULL, // func withdrawn set 189 _ecore_evas_wl_withdrawn_set,
188 NULL, // func sticky set 190 NULL, // func sticky set
189 _ecore_evas_wl_ignore_events_set, 191 _ecore_evas_wl_ignore_events_set,
190 _ecore_evas_wl_alpha_set, 192 _ecore_evas_wl_alpha_set,
@@ -699,6 +701,7 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
699 701
700 munmap(ee->engine.wl.pool_data, ee->engine.wl.pool_size); 702 munmap(ee->engine.wl.pool_data, ee->engine.wl.pool_size);
701 703
704
702 einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas); 705 einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
703 if ((einfo) && (einfo->info.dest)) 706 if ((einfo) && (einfo->info.dest))
704 { 707 {
@@ -706,10 +709,12 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
706 evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); 709 evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
707 } 710 }
708 711
709 ecore_wl_window_hide(ee->engine.wl.win); 712 if (ee->engine.wl.win)
713 ecore_wl_window_hide(ee->engine.wl.win);
710 714
711 ee->visible = 0; 715 ee->visible = 0;
712 ee->should_be_visible = 0; 716 ee->should_be_visible = 0;
717 _ecore_evas_wl_frame_callback_clean (ee);
713 718
714 if (ee->func.fn_hide) ee->func.fn_hide(ee); 719 if (ee->func.fn_hide) ee->func.fn_hide(ee);
715} 720}
@@ -864,6 +869,17 @@ _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full)
864 ee->func.fn_state_change(ee); 869 ee->func.fn_state_change(ee);
865} 870}
866 871
872static void
873_ecore_evas_wl_withdrawn_set(Ecore_Evas *ee, int val)
874{
875 LOGFN(__FILE__, __LINE__, __FUNCTION__);
876
877 if (val)
878 ecore_evas_hide(ee);
879 else
880 ecore_evas_show(ee);
881}
882
867static void 883static void
868_ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore) 884_ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore)
869{ 885{
@@ -962,7 +978,19 @@ _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent)
962} 978}
963 979
964static void 980static void
965_ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback, uint32_t tm EINA_UNUSED) 981_ecore_evas_wl_frame_callback_clean(Ecore_Evas *ee)
982{
983 Ecore_Wl_Window *win = ee->engine.wl.win;
984
985 if (!win->frame_pending)
986 return;
987 wl_callback_destroy(win->frame_callback);
988 win->frame_callback = NULL;
989 win->frame_pending = EINA_FALSE;
990}
991
992static void
993_ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback EINA_UNUSED, uint32_t tm EINA_UNUSED)
966{ 994{
967 Ecore_Evas *ee = data; 995 Ecore_Evas *ee = data;
968 Ecore_Wl_Window *win = NULL; 996 Ecore_Wl_Window *win = NULL;
@@ -970,9 +998,7 @@ _ecore_evas_wl_frame_complete(void *data, struct wl_callback *callback, uint32_t
970 if (!ee) return; 998 if (!ee) return;
971 if (!(win = ee->engine.wl.win)) return; 999 if (!(win = ee->engine.wl.win)) return;
972 1000
973 win->frame_callback = NULL; 1001 _ecore_evas_wl_frame_callback_clean(ee);
974 win->frame_pending = EINA_FALSE;
975 wl_callback_destroy(callback);
976 1002
977 if (win->surface) 1003 if (win->surface)
978 { 1004 {