mirror of https://github.com/mpv-player/mpv
wayland_common: add support for embedding
This commit is contained in:
parent
bee6ca5225
commit
8d8d4c5cb1
|
@ -2471,6 +2471,10 @@ Window
|
||||||
window fully. The value ``0`` is interpreted specially, and mpv will
|
window fully. The value ``0`` is interpreted specially, and mpv will
|
||||||
draw directly on the root window.
|
draw directly on the root window.
|
||||||
|
|
||||||
|
On wayland, the ID is interpreted as ``struct zxdg_toplevel_v6 *``. Pass it
|
||||||
|
as value cast to ``intptr_t``. mpv will create its own window, and set the
|
||||||
|
wid toplevel as its parent.
|
||||||
|
|
||||||
On win32, the ID is interpreted as ``HWND``. Pass it as value cast to
|
On win32, the ID is interpreted as ``HWND``. Pass it as value cast to
|
||||||
``intptr_t``. mpv will create its own window, and set the wid window as
|
``intptr_t``. mpv will create its own window, and set the wid window as
|
||||||
parent, like with X11.
|
parent, like with X11.
|
||||||
|
|
|
@ -879,6 +879,10 @@ static int create_surface(struct vo_wayland_state *wl)
|
||||||
wl->xdg_toplevel = zxdg_surface_v6_get_toplevel(wl->xdg_surface);
|
wl->xdg_toplevel = zxdg_surface_v6_get_toplevel(wl->xdg_surface);
|
||||||
zxdg_toplevel_v6_add_listener(wl->xdg_toplevel, &xdg_toplevel_listener, wl);
|
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_title (wl->xdg_toplevel, "mpv");
|
||||||
zxdg_toplevel_v6_set_app_id(wl->xdg_toplevel, "mpv");
|
zxdg_toplevel_v6_set_app_id(wl->xdg_toplevel, "mpv");
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@ struct vo_wayland_state {
|
||||||
struct wl_surface *surface;
|
struct wl_surface *surface;
|
||||||
struct zxdg_shell_v6 *shell;
|
struct zxdg_shell_v6 *shell;
|
||||||
struct zxdg_toplevel_v6 *xdg_toplevel;
|
struct zxdg_toplevel_v6 *xdg_toplevel;
|
||||||
|
struct zxdg_toplevel_v6 *xdg_tl_parent;
|
||||||
struct zxdg_surface_v6 *xdg_surface;
|
struct zxdg_surface_v6 *xdg_surface;
|
||||||
struct org_kde_kwin_server_decoration_manager *server_decoration_manager;
|
struct org_kde_kwin_server_decoration_manager *server_decoration_manager;
|
||||||
struct org_kde_kwin_server_decoration *server_decoration;
|
struct org_kde_kwin_server_decoration *server_decoration;
|
||||||
|
|
Loading…
Reference in New Issue