From 41308aa72918b9b46f0aedfff052c47fe3585bba Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Tue, 8 Jan 2013 07:21:47 +0000 Subject: [PATCH] From: Alex Wu Date: Sat, 5 Jan 2013 10:50:19 +0800 Subject: [PATCH] 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(). Signed-off-by: Christopher Michael SVN revision: 82385 --- src/lib/ecore_wayland/ecore_wl_window.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index f20b3c693a..3ba06d8124 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c @@ -241,8 +241,7 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, in return; } - if (!win->surface) - return; + if (!win->surface) return; if (win->region.input) { @@ -425,7 +424,7 @@ ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h) win->allocation.w = w; win->allocation.h = h; - if (!win->transparent || !win->alpha) + if ((!win->transparent) || (!win->alpha)) { if (win->region.opaque) wl_region_destroy(win->region.opaque); win->region.opaque =