forked from enlightenment/efl
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
This commit is contained in:
parent
a8cc6e9e16
commit
67769cc39f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue