diff options
author | nanahi <130121847+na-na-hi@users.noreply.github.com> | 2024-02-12 23:36:40 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-02-17 16:09:41 +0000 |
commit | 27d973ba342288aecf6dacd37cc7ea1f2f104a48 (patch) | |
tree | 8ebe50c4d1ab1d9d9a953921de766a511436be07 /video/out/wayland_common.c | |
parent | 2274311b259b7b03e3764ab4c21d69988b70a337 (diff) | |
download | mpv-27d973ba342288aecf6dacd37cc7ea1f2f104a48.tar.bz2 mpv-27d973ba342288aecf6dacd37cc7ea1f2f104a48.tar.xz |
wayland_common: drop unnecessary xdg_toplevel null check
The vo init already fails if xdg_toplevel creation fails, so these
checks after the vo is initialized is unnecessary.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index dc3f9a4347..75c84445bb 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -300,7 +300,7 @@ static void pointer_handle_button(void *data, struct wl_pointer *wl_pointer, // Implement an edge resize zone if there are no decorations if (!wl->vo_opts->border && check_for_resize(wl, wl->opts->edge_pixels_pointer, &edges)) { xdg_toplevel_resize(wl->xdg_toplevel, s->seat, serial, edges); - } else if (wl->xdg_toplevel) { + } else { xdg_toplevel_move(wl->xdg_toplevel, s->seat, serial); } // Explicitly send an UP event after the client finishes a move/resize @@ -1686,8 +1686,6 @@ static void add_feedback(struct vo_wayland_feedback_pool *fback_pool, static void do_minimize(struct vo_wayland_state *wl) { - if (!wl->xdg_toplevel) - return; if (wl->vo_opts->window_minimized) xdg_toplevel_set_minimized(wl->xdg_toplevel); } @@ -2075,8 +2073,6 @@ static int spawn_cursor(struct vo_wayland_state *wl) static void toggle_fullscreen(struct vo_wayland_state *wl) { - if (!wl->xdg_toplevel) - return; wl->state_change = true; bool specific_screen = wl->vo_opts->fsscreen_id >= 0 || wl->vo_opts->fsscreen_name; if (wl->vo_opts->fullscreen && !specific_screen) { @@ -2091,8 +2087,6 @@ static void toggle_fullscreen(struct vo_wayland_state *wl) static void toggle_maximized(struct vo_wayland_state *wl) { - if (!wl->xdg_toplevel) - return; wl->state_change = true; if (wl->vo_opts->window_maximized) { xdg_toplevel_set_maximized(wl->xdg_toplevel); @@ -2103,15 +2097,11 @@ static void toggle_maximized(struct vo_wayland_state *wl) static void update_app_id(struct vo_wayland_state *wl) { - if (!wl->xdg_toplevel) - return; xdg_toplevel_set_app_id(wl->xdg_toplevel, wl->vo_opts->appid); } static int update_window_title(struct vo_wayland_state *wl, const char *title) { - if (!wl->xdg_toplevel) - return VO_NOTAVAIL; /* The xdg-shell protocol requires that the title is UTF-8. */ void *tmp = talloc_new(NULL); struct bstr b_title = bstr_sanitize_utf8_latin1(tmp, bstr0(title)); |