summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2013-01-08 07:21:32 +0000
committerChristopher Michael <cpmichael1@comcast.net>2013-01-08 07:21:32 +0000
commit67769cc39fed35080fe8c145ba7a9635124f77b9 (patch)
treea76886367d497b6198c997e5ab0441691de1cc48 /src
parenta8cc6e9e163cba4ef6bf359e5d7a53f275affe73 (diff)
ecore-wayland: Improve opaque setting logic.
1. Update win->region.opaque in ecore_wl_window_update_size, so that the opaque info is synced with the geometry. 2. Add win->surface checking in ecore_wl_window_buffer_attach before send any wl_surface related request, it will avoid segfault in case that calling ecore_wl_window_buffer_attach() before ecore_wl_window_show(). SVN revision: 82384
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_wayland/ecore_wl_window.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c
index 13ea38fcab..f20b3c693a 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -241,6 +241,9 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, in
241 return; 241 return;
242 } 242 }
243 243
244 if (!win->surface)
245 return;
246
244 if (win->region.input) 247 if (win->region.input)
245 { 248 {
246 wl_surface_set_input_region(win->surface, win->region.input); 249 wl_surface_set_input_region(win->surface, win->region.input);
@@ -421,6 +424,15 @@ ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h)
421 if (!win) return; 424 if (!win) return;
422 win->allocation.w = w; 425 win->allocation.w = w;
423 win->allocation.h = h; 426 win->allocation.h = h;
427
428 if (!win->transparent || !win->alpha)
429 {
430 if (win->region.opaque) wl_region_destroy(win->region.opaque);
431 win->region.opaque =
432 wl_compositor_create_region(_ecore_wl_disp->wl.compositor);
433 wl_region_add(win->region.opaque, win->allocation.x, win->allocation.y,
434 win->allocation.w, win->allocation.h);
435 }
424} 436}
425 437
426EAPI void 438EAPI void