forked from enlightenment/efl
Add back saving of opaque region into window structure.
NB: Needed so that we can reset the opaque region if alpha_set is being toggled on/off all the time. Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
d673cbc398
commit
dc01222858
|
@ -222,6 +222,11 @@ struct _Ecore_Wl_Window
|
|||
int w, h;
|
||||
} saved, server;
|
||||
|
||||
struct
|
||||
{
|
||||
int x, y, w, h;
|
||||
} opaque;
|
||||
|
||||
/* Eina_Bool redraw_scheduled : 1; */
|
||||
/* Eina_Bool resize_scheduled : 1; */
|
||||
Eina_Bool alpha : 1;
|
||||
|
|
|
@ -80,6 +80,11 @@ ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, int w, int h, int buf
|
|||
win->buffer_type = buffer_type;
|
||||
win->id = _win_id++;
|
||||
|
||||
win->opaque.x = x;
|
||||
win->opaque.y = y;
|
||||
win->opaque.w = w;
|
||||
win->opaque.h = h;
|
||||
|
||||
eina_hash_add(_windows, _ecore_wl_window_id_str_get(win->id), win);
|
||||
return win;
|
||||
}
|
||||
|
@ -435,6 +440,9 @@ ecore_wl_window_alpha_set(Ecore_Wl_Window *win, Eina_Bool alpha)
|
|||
win->alpha = alpha;
|
||||
if (win->alpha)
|
||||
ecore_wl_window_opaque_region_set(win, 0, 0, 0, 0);
|
||||
else
|
||||
ecore_wl_window_opaque_region_set(win, win->opaque.x, win->opaque.y,
|
||||
win->opaque.w, win->opaque.h);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
|
@ -629,6 +637,11 @@ ecore_wl_window_opaque_region_set(Ecore_Wl_Window *win, int x, int y, int w, int
|
|||
wl_region_add(region, x, y, w, h);
|
||||
wl_surface_set_opaque_region(win->surface, region);
|
||||
wl_region_destroy(region);
|
||||
|
||||
win->opaque.x = x;
|
||||
win->opaque.y = y;
|
||||
win->opaque.w = w;
|
||||
win->opaque.h = h;
|
||||
}
|
||||
else
|
||||
wl_surface_set_opaque_region(win->surface, NULL);
|
||||
|
|
Loading…
Reference in New Issue