summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wayland
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-04-27 13:00:07 -0400
committerChris Michael <cp.michael@samsung.com>2015-04-27 13:20:59 -0400
commitf03cf3dba3f968839778541fd89ec3f3007fb559 (patch)
treeb5a65350b0a18fa9f495192d732fe3f777dbfd1d /src/lib/ecore_wayland
parentf93cc6fe3b0b3022955f528a154918b6f34be635 (diff)
ecore-wayland: Fix issue of efl/elm apps not setting opaque & input regions
Summary: Since evas handles surface damage & surface commit roles now, we no longer are calling ecore_wl_commit inside ecore_evas. This was causing the surface opaque & input regions to no longer be set. We fix that here by creating and setting opaque/input regions whenever the appropriate ecore_wl region functions are called. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_wayland')
-rw-r--r--src/lib/ecore_wayland/ecore_wl_private.h3
-rw-r--r--src/lib/ecore_wayland/ecore_wl_window.c60
2 files changed, 23 insertions, 40 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_private.h b/src/lib/ecore_wayland/ecore_wl_private.h
index d0aeeb5..77c12db 100644
--- a/src/lib/ecore_wayland/ecore_wl_private.h
+++ b/src/lib/ecore_wayland/ecore_wl_private.h
@@ -117,9 +117,6 @@ struct _Ecore_Wl_Window
117 int ivi_surface_id; 117 int ivi_surface_id;
118# endif 118# endif
119 119
120 struct wl_region *opaque_region;
121 struct wl_region *input_region;
122
123 struct xdg_surface *xdg_surface; 120 struct xdg_surface *xdg_surface;
124 struct xdg_popup *xdg_popup; 121 struct xdg_popup *xdg_popup;
125 Eina_Bool focused : 1; 122 Eina_Bool focused : 1;
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c
index 8f2f192..8811ded 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -99,12 +99,6 @@ ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, int w, int h, int buf
99 win->opaque.w = w; 99 win->opaque.w = w;
100 win->opaque.h = h; 100 win->opaque.h = h;
101 101
102 win->opaque_region =
103 wl_compositor_create_region(_ecore_wl_compositor_get());
104
105 win->input_region =
106 wl_compositor_create_region(_ecore_wl_compositor_get());
107
108 win->title = NULL; 102 win->title = NULL;
109 win->class_name = NULL; 103 win->class_name = NULL;
110 104
@@ -140,9 +134,6 @@ ecore_wl_window_free(Ecore_Wl_Window *win)
140 134
141 if (win->subsurfs) _ecore_wl_subsurfs_del_all(win); 135 if (win->subsurfs) _ecore_wl_subsurfs_del_all(win);
142 136
143 if (win->input_region) wl_region_destroy(win->input_region);
144 if (win->opaque_region) wl_region_destroy(win->opaque_region);
145
146#ifdef USE_IVI_SHELL 137#ifdef USE_IVI_SHELL
147 if (win->ivi_surface) ivi_surface_destroy(win->ivi_surface); 138 if (win->ivi_surface) ivi_surface_destroy(win->ivi_surface);
148 win->ivi_surface = NULL; 139 win->ivi_surface = NULL;
@@ -240,18 +231,6 @@ ecore_wl_window_commit(Ecore_Wl_Window *win)
240 231
241 if (!win) return; 232 if (!win) return;
242 233
243 if (win->opaque_region)
244 {
245 if (win->surface)
246 wl_surface_set_opaque_region(win->surface, win->opaque_region);
247 }
248
249 if (win->input_region)
250 {
251 if (win->surface)
252 wl_surface_set_input_region(win->surface, win->input_region);
253 }
254
255 if ((win->surface) && (win->has_buffer)) 234 if ((win->surface) && (win->has_buffer))
256 wl_surface_commit(win->surface); 235 wl_surface_commit(win->surface);
257} 236}
@@ -834,21 +813,29 @@ ecore_wl_window_input_region_set(Ecore_Wl_Window *win, int x, int y, int w, int
834 813
835 if (win->type != ECORE_WL_WINDOW_TYPE_DND) 814 if (win->type != ECORE_WL_WINDOW_TYPE_DND)
836 { 815 {
816 struct wl_region *region;
817
818 region = wl_compositor_create_region(_ecore_wl_compositor_get());
819 if (!region) return;
820
837 switch (win->rotation) 821 switch (win->rotation)
838 { 822 {
839 case 0: 823 case 0:
840 wl_region_add(win->input_region, x, y, w, h); 824 wl_region_add(region, x, y, w, h);
841 break; 825 break;
842 case 180: 826 case 180:
843 wl_region_add(win->input_region, x, x + y, w, h); 827 wl_region_add(region, x, x + y, w, h);
844 break; 828 break;
845 case 90: 829 case 90:
846 wl_region_add(win->input_region, y, x, h, w); 830 wl_region_add(region, y, x, h, w);
847 break; 831 break;
848 case 270: 832 case 270:
849 wl_region_add(win->input_region, x + y, x, h, w); 833 wl_region_add(region, x + y, x, h, w);
850 break; 834 break;
851 } 835 }
836
837 wl_surface_set_input_region(win->surface, region);
838 wl_region_destroy(region);
852 } 839 }
853} 840}
854 841
@@ -856,6 +843,8 @@ ecore_wl_window_input_region_set(Ecore_Wl_Window *win, int x, int y, int w, int
856EAPI void 843EAPI void
857ecore_wl_window_opaque_region_set(Ecore_Wl_Window *win, int x, int y, int w, int h) 844ecore_wl_window_opaque_region_set(Ecore_Wl_Window *win, int x, int y, int w, int h)
858{ 845{
846 struct wl_region *region;
847
859 LOGFN(__FILE__, __LINE__, __FUNCTION__); 848 LOGFN(__FILE__, __LINE__, __FUNCTION__);
860 849
861 if (!win) return; 850 if (!win) return;
@@ -867,30 +856,27 @@ ecore_wl_window_opaque_region_set(Ecore_Wl_Window *win, int x, int y, int w, int
867 856
868 if ((win->transparent) || (win->alpha)) return; 857 if ((win->transparent) || (win->alpha)) return;
869 858
859 region = wl_compositor_create_region(_ecore_wl_compositor_get());
860 if (!region) return;
861
870 switch (win->rotation) 862 switch (win->rotation)
871 { 863 {
872 case 0: 864 case 0:
873 wl_region_add(win->opaque_region, x, y, w, h); 865 wl_region_add(region, x, y, w, h);
874 break; 866 break;
875 case 180: 867 case 180:
876 wl_region_add(win->opaque_region, x, x + y, w, h); 868 wl_region_add(region, x, x + y, w, h);
877 break; 869 break;
878 case 90: 870 case 90:
879 wl_region_add(win->opaque_region, y, x, h, w); 871 wl_region_add(region, y, x, h, w);
880 break; 872 break;
881 case 270: 873 case 270:
882 wl_region_add(win->opaque_region, x + y, x, h, w); 874 wl_region_add(region, x + y, x, h, w);
883 break; 875 break;
884 } 876 }
885 877
886 /* if ((w > 0) && (h > 0)) */ 878 wl_surface_set_opaque_region(win->surface, region);
887 /* { */ 879 wl_region_destroy(region);
888 /* if ((win->opaque.w == w) && (win->opaque.h == h)) */
889 /* return; */
890
891 /* win->opaque.w = w; */
892 /* win->opaque.h = h; */
893 /* } */
894} 880}
895 881
896/* @since 1.8 */ 882/* @since 1.8 */