From 4b5ead0834deaf2896c39952daf2e622a5959b4f Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Wed, 12 Aug 2020 09:41:56 -0500 Subject: 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. --- video/out/wayland_common.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'video') 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; -- cgit v1.2.3