mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
waylandsink: Simplify input region handling
We only need to unset the input region for the area surface when we don't have our own toplevel surface. By default, the input region covers the whole surface, thus no need to change it on resize. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1446>
This commit is contained in:
parent
1e2bc68171
commit
b03c7edfcf
1 changed files with 7 additions and 15 deletions
|
@ -222,11 +222,7 @@ gst_wl_window_new_internal (GstWlDisplay * display, GMutex * render_lock)
|
|||
window->video_surface);
|
||||
}
|
||||
|
||||
/* do not accept input */
|
||||
region = wl_compositor_create_region (display->compositor);
|
||||
wl_surface_set_input_region (window->area_surface, region);
|
||||
wl_region_destroy (region);
|
||||
|
||||
/* never accept input events on the video surface */
|
||||
region = wl_compositor_create_region (display->compositor);
|
||||
wl_surface_set_input_region (window->video_surface, region);
|
||||
wl_region_destroy (region);
|
||||
|
@ -345,8 +341,14 @@ gst_wl_window_new_in_surface (GstWlDisplay * display,
|
|||
struct wl_surface * parent, GMutex * render_lock)
|
||||
{
|
||||
GstWlWindow *window;
|
||||
struct wl_region *region;
|
||||
window = gst_wl_window_new_internal (display, render_lock);
|
||||
|
||||
/* do not accept input events on the area surface when embedded */
|
||||
region = wl_compositor_create_region (display->compositor);
|
||||
wl_surface_set_input_region (window->area_surface, region);
|
||||
wl_region_destroy (region);
|
||||
|
||||
/* embed in parent */
|
||||
window->area_subsurface =
|
||||
wl_subcompositor_get_subsurface (display->subcompositor,
|
||||
|
@ -412,16 +414,6 @@ gst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit)
|
|||
wl_surface_commit (window->video_surface_wrapper);
|
||||
}
|
||||
|
||||
if (gst_wl_window_is_toplevel (window)) {
|
||||
struct wl_region *region;
|
||||
|
||||
region = wl_compositor_create_region (window->display->compositor);
|
||||
wl_region_add (region, 0, 0, window->render_rectangle.w,
|
||||
window->render_rectangle.h);
|
||||
wl_surface_set_input_region (window->area_surface, region);
|
||||
wl_region_destroy (region);
|
||||
}
|
||||
|
||||
/* this is saved for use in wl_surface_damage */
|
||||
window->video_rectangle = res;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue