summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2017-10-05 16:17:05 +0100
committerRostislav Pehlivanov <atomnuker@gmail.com>2017-10-05 16:23:15 +0100
commit8d8d4c5cb1b3553215a8ba547d4db463fdc88831 (patch)
tree9ca7f346c658c9ddea158470cb31967532a0af03 /video/out
parentbee6ca5225e915f64ee36aaea1f66ada20f18e4c (diff)
downloadmpv-8d8d4c5cb1b3553215a8ba547d4db463fdc88831.tar.bz2
mpv-8d8d4c5cb1b3553215a8ba547d4db463fdc88831.tar.xz
wayland_common: add support for embedding
Diffstat (limited to 'video/out')
-rw-r--r--video/out/wayland_common.c4
-rw-r--r--video/out/wayland_common.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index fc8a07c85d..6c1c33b1dc 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -879,6 +879,10 @@ static int create_surface(struct vo_wayland_state *wl)
wl->xdg_toplevel = zxdg_surface_v6_get_toplevel(wl->xdg_surface);
zxdg_toplevel_v6_add_listener(wl->xdg_toplevel, &xdg_toplevel_listener, wl);
+ if (wl->vo->opts->WinID >= 0)
+ wl->xdg_tl_parent = (struct zxdg_toplevel_v6 *)(intptr_t)wl->vo->opts->WinID;
+ zxdg_toplevel_v6_set_parent(wl->xdg_toplevel, wl->xdg_tl_parent);
+
zxdg_toplevel_v6_set_title (wl->xdg_toplevel, "mpv");
zxdg_toplevel_v6_set_app_id(wl->xdg_toplevel, "mpv");
diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h
index 60d5924efa..0a6965b8ac 100644
--- a/video/out/wayland_common.h
+++ b/video/out/wayland_common.h
@@ -75,6 +75,7 @@ struct vo_wayland_state {
struct wl_surface *surface;
struct zxdg_shell_v6 *shell;
struct zxdg_toplevel_v6 *xdg_toplevel;
+ struct zxdg_toplevel_v6 *xdg_tl_parent;
struct zxdg_surface_v6 *xdg_surface;
struct org_kde_kwin_server_decoration_manager *server_decoration_manager;
struct org_kde_kwin_server_decoration *server_decoration;