From: Christopher Michael Date: Tue, 8 Jan 2013 07:21:32 +0000 (+0000) Subject: ecore-wayland: Improve opaque setting logic. X-Git-Tag: submit/devel/efl/20131022.203902~2440 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=67769cc39fed35080fe8c145ba7a9635124f77b9;p=platform%2Fupstream%2Fefl.git 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 --- diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index 13ea38f..f20b3c6 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 return; } + if (!win->surface) + return; + if (win->region.input) { 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) if (!win) return; win->allocation.w = w; win->allocation.h = h; + + if (!win->transparent || !win->alpha) + { + if (win->region.opaque) wl_region_destroy(win->region.opaque); + win->region.opaque = + wl_compositor_create_region(_ecore_wl_disp->wl.compositor); + wl_region_add(win->region.opaque, win->allocation.x, win->allocation.y, + win->allocation.w, win->allocation.h); + } } EAPI void