summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
diff options
context:
space:
mode:
authorAlexander Preisinger <alexander.preisinger@gmail.com>2014-06-15 14:46:27 +0200
committerAlexander Preisinger <alexander.preisinger@gmail.com>2014-06-15 14:46:27 +0200
commit73121dbcc164c69ab461996c233bc5f4634312c1 (patch)
tree4969d4ea829aecbda0a9283bb6a10d39785295a7 /video/out/wayland_common.c
parentf14b45588e7804388c2e2a98cbc5e91ce21942dd (diff)
downloadmpv-73121dbcc164c69ab461996c233bc5f4634312c1.tar.bz2
mpv-73121dbcc164c69ab461996c233bc5f4634312c1.tar.xz
wayland: move subsurfaces to wayland vo
Subsurfaces are only used by the wayland vo. Thats why it makes sense to move all osd and subsurface specific parts to the vo_wayland.c Also destroy the subsurfaces and subcompositor properly.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r--video/out/wayland_common.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 005408751e..fe6142c89a 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -744,6 +744,9 @@ static void destroy_display (struct vo_wayland_state *wl)
if (wl->display.shell)
wl_shell_destroy(wl->display.shell);
+ if (wl->display.subcomp)
+ wl_subcompositor_destroy(wl->display.subcomp);
+
if (wl->display.compositor)
wl_compositor_destroy(wl->display.compositor);
@@ -763,26 +766,6 @@ static bool create_window (struct vo_wayland_state *wl)
wl->window.shell_surface =
wl_shell_get_shell_surface(wl->display.shell, wl->window.video_surface);
- // Commits on surfaces bound to a subsurface are cached until the parent
- // surface is commited, in this case the video surface.
- // Which means we can call commit anywhere.
- struct wl_region *input =
- wl_compositor_create_region(wl->display.compositor);
- for (int i = 0; i < MAX_OSD_PARTS; ++i) {
- wl->window.osd_surfaces[i] =
- wl_compositor_create_surface(wl->display.compositor);
- wl_surface_attach(wl->window.osd_surfaces[i], NULL, 0, 0);
- wl_surface_set_input_region(wl->window.osd_surfaces[i], input);
- wl->window.osd_subsurfaces[i] =
- wl_subcompositor_get_subsurface(wl->display.subcomp,
- wl->window.osd_surfaces[i],
- wl->window.video_surface); // parent
- wl_surface_commit(wl->window.osd_surfaces[i]);
- wl_subsurface_set_sync(wl->window.osd_subsurfaces[i]);
- }
-
- wl_region_destroy(input);
-
if (!wl->window.shell_surface) {
MP_ERR(wl, "creating shell surface failed\n");
return false;