diff --git a/ChangeLog b/ChangeLog index 9608f7222a..7ace6c4255 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-05-06 Rafael Antognolli + + * Ecore/Wayland: Add ecore_wl_window_alpha_set/get(). + * Ecore/Wayland: Fix alpha windows on EGL backend. + 2013-05-06 Cedric Bail * Evas: Remove SVG loader from inside the merged tree. diff --git a/NEWS b/NEWS index dce388e1fe..a7d4d5c573 100644 --- a/NEWS +++ b/NEWS @@ -53,6 +53,7 @@ Additions: - Add #ifdef __cplusplus to Ecore_Wayland.h so C++ programs can link to and use the API. - Add support for double and triple click. + - Add ecore_wl_window_alpha_set/get(). * ecore_evas: - ecore_evas_window_profile_supported_get() - ecore_evas_window_profile_set() diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index 85422b820f..120c6f1b31 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c @@ -161,13 +161,7 @@ ecore_wl_window_resize(Ecore_Wl_Window *win, int w, int h, int location) win->allocation.w, win->allocation.h); } - if (!win->transparent) - { - 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); - } + ecore_wl_window_update_size(win, w, h); if (win->shell_surface) { @@ -187,6 +181,22 @@ ecore_wl_window_resize(Ecore_Wl_Window *win, int w, int h, int location) wl_shell_surface_resize(win->shell_surface, input->seat, input->display->serial, location); } + + if (win->region.input) + { + if (win->surface) + wl_surface_set_input_region(win->surface, win->region.input); + wl_region_destroy(win->region.input); + win->region.input = NULL; + } + + if (win->surface) + wl_surface_set_opaque_region(win->surface, win->region.opaque); + if (win->region.opaque) + { + wl_region_destroy(win->region.opaque); + win->region.opaque = NULL; + } } EAPI void @@ -242,22 +252,6 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, in default: return; } - - if (win->region.input) - { - if (win->surface) - wl_surface_set_input_region(win->surface, win->region.input); - wl_region_destroy(win->region.input); - win->region.input = NULL; - } - - if (win->region.opaque) - { - if (win->surface) - wl_surface_set_opaque_region(win->surface, win->region.opaque); - wl_region_destroy(win->region.opaque); - win->region.opaque = NULL; - } } EAPI struct wl_surface* @@ -445,7 +439,7 @@ ecore_wl_window_transparent_set(Ecore_Wl_Window *win, Eina_Bool transparent) win->transparent = transparent; if (win->region.opaque) wl_region_destroy(win->region.opaque); win->region.opaque = NULL; - if (!win->transparent) + if ((!win->transparent) && (!win->alpha)) { win->region.opaque = wl_compositor_create_region(_ecore_wl_disp->wl.compositor); @@ -501,14 +495,18 @@ 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->region.opaque) wl_region_destroy(win->region.opaque); + + 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); } + else + win->region.opaque = NULL; + } EAPI void diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index 22e8c1a588..64cc8244c7 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -295,12 +295,10 @@ _rotation_do(Ecore_Evas *ee, int rotation, int resize) if ((rotation == 0) || (rotation == 180)) { ecore_wl_window_resize(wdata->win, ee->h + fw, ee->w + fh, 0); - ecore_wl_window_update_size(wdata->win, ee->h + fw, ee->w + fh); } else { ecore_wl_window_resize(wdata->win, ee->h + fh, ee->w + fw, 0); - ecore_wl_window_update_size(wdata->win, ee->h + fh, ee->w + fw); } if ((ee->rotation == 0) || (ee->rotation == 180)) { diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c index ccff29e318..89b5ee9078 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c @@ -507,12 +507,10 @@ _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location) if ((ee->rotation == 0) || (ee->rotation == 180)) { ecore_wl_window_resize(wdata->win, ee->w + fw, ee->h + fh, location); - ecore_wl_window_update_size(wdata->win, ee->w + fw, ee->h + fh); } else { ecore_wl_window_resize(wdata->win, ee->w + fh, ee->h + fw, location); - ecore_wl_window_update_size(wdata->win, ee->w + fh, ee->h + fw); } } }