summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2020-08-12 09:41:56 -0500
committerDudemanguy <random342@airmail.cc>2020-08-14 13:02:01 +0000
commit4b5ead0834deaf2896c39952daf2e622a5959b4f (patch)
tree056ab16fb98b30eceac93322f3335a2c420b0bc4
parentdec98ad00e731921f29308afadb3a0269677edb9 (diff)
downloadmpv-4b5ead0834deaf2896c39952daf2e622a5959b4f.tar.bz2
mpv-4b5ead0834deaf2896c39952daf2e622a5959b4f.tar.xz
wayland: tweak xdg_surface creation
Just some small changes when creating the xdg_surface. Don't set the toplevel title (or app id) in create_xdg_surface anymore because it's entirely pointless. Also make it possible for create_xdg_surface to return something other than 0 so the error checking is somewhat meaningful. It's not really clear if these xdg functions can even fail in the first place (perhaps some weird proxy marshalling crap could possibly go wrong somehow), but it can't hurt. Note that all app id stuff has been removed (temporarily) in this commit. See the next commit which adds it back in.
-rw-r--r--video/out/wayland_common.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 1665919465..e00adac338 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -1055,9 +1055,8 @@ static int create_xdg_surface(struct vo_wayland_state *wl)
wl->xdg_toplevel = xdg_surface_get_toplevel(wl->xdg_surface);
xdg_toplevel_add_listener(wl->xdg_toplevel, &xdg_toplevel_listener, wl);
- xdg_toplevel_set_title (wl->xdg_toplevel, "mpv");
- xdg_toplevel_set_app_id(wl->xdg_toplevel, "mpv");
-
+ if (!wl->xdg_surface || !wl->xdg_toplevel)
+ return 1;
return 0;
}
@@ -1423,7 +1422,7 @@ static void do_minimize(struct vo_wayland_state *wl)
xdg_toplevel_set_minimized(wl->xdg_toplevel);
}
-static int update_window_title(struct vo_wayland_state *wl, char *title)
+static int update_window_title(struct vo_wayland_state *wl, const char *title)
{
if (!wl->xdg_toplevel)
return VO_NOTAVAIL;
@@ -1544,7 +1543,7 @@ int vo_wayland_control(struct vo *vo, int *events, int request, void *arg)
return VO_TRUE;
}
case VOCTRL_UPDATE_WINDOW_TITLE:
- return update_window_title(wl, (char *)arg);
+ return update_window_title(wl, (const char *)arg);
case VOCTRL_SET_CURSOR_VISIBILITY:
if (!wl->pointer)
return VO_NOTAVAIL;