summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2021-11-08 09:44:22 -0600
committerDudemanguy <random342@airmail.cc>2021-11-08 09:49:49 -0600
commitf5d545c9174216339defc222e54d419d631f5805 (patch)
tree9c61d72031e3bd0b1b8308fc6825f985929d4fcc /video/out/wayland_common.c
parent73563cebf9ae6c3c8f5ca4a84f67b2e96c08f51f (diff)
downloadmpv-f5d545c9174216339defc222e54d419d631f5805.tar.bz2
mpv-f5d545c9174216339defc222e54d419d631f5805.tar.xz
wayland: remove bogus scale_change variable
This was originally added in f2afae55e95b4b1eec1aeb828ba6ff1f0695d993 for unclear reasons (way to go me). This concept is clearly incorrect. It doesn't matter what state the window is in. As soon as mpv detects a scale change, it needs to reset the buffer scale of the window. Just remove all this junk and put wl_surface_set_buffer_scale in set_surface_scaling like it should be. Related issue: #9426.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r--video/out/wayland_common.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index 72bacad15d..2a3cb8a57e 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -646,11 +646,6 @@ static void output_handle_done(void* data, struct wl_output *wl_output)
* geometry and scaling should be recalculated. */
if (wl->current_output && wl->current_output->output == wl_output) {
set_surface_scaling(wl);
- if (!wl->vo_opts->fullscreen && !wl->vo_opts->window_maximized) {
- wl_surface_set_buffer_scale(wl->surface, wl->scaling);
- } else {
- wl->scale_change = true;
- }
spawn_cursor(wl);
set_geometry(wl);
wl->window_size = wl->vdparams;
@@ -702,11 +697,6 @@ static void surface_handle_enter(void *data, struct wl_surface *wl_surface,
if (wl->scaling != wl->current_output->scale) {
set_surface_scaling(wl);
- if (!wl->vo_opts->fullscreen && !wl->vo_opts->window_maximized) {
- wl->scale_change = true;
- } else {
- wl_surface_set_buffer_scale(wl->surface, wl->scaling);
- }
spawn_cursor(wl);
wl->pending_vo_events |= VO_EVENT_DPI;
}
@@ -846,11 +836,6 @@ static void handle_toplevel_config(void *data, struct xdg_toplevel *toplevel,
}
}
- if (wl->scale_change) {
- wl_surface_set_buffer_scale(wl->surface, wl->scaling);
- wl->scale_change = false;
- }
-
if (wl->state_change) {
if (!is_fullscreen && !is_maximized) {
wl->geometry = wl->window_size;
@@ -1419,6 +1404,7 @@ static void set_surface_scaling(struct vo_wayland_state *wl)
wl->vdparams.y1 *= factor;
wl->window_size.x1 *= factor;
wl->window_size.y1 *= factor;
+ wl_surface_set_buffer_scale(wl->surface, wl->scaling);
}
static int spawn_cursor(struct vo_wayland_state *wl)
@@ -1583,14 +1569,7 @@ int vo_wayland_control(struct vo *vo, int *events, int request, void *arg)
if (opt == &opts->fullscreen)
toggle_fullscreen(wl);
if (opt == &opts->hidpi_window_scale)
- {
set_surface_scaling(wl);
- if (!wl->vo_opts->fullscreen && !wl->vo_opts->window_maximized) {
- wl_surface_set_buffer_scale(wl->surface, wl->scaling);
- } else {
- wl->scale_change = true;
- }
- }
if (opt == &opts->window_maximized)
toggle_maximized(wl);
if (opt == &opts->window_minimized)
@@ -1789,7 +1768,6 @@ int vo_wayland_reconfig(struct vo *vo)
if (!wl->current_output)
return false;
set_surface_scaling(wl);
- wl_surface_set_buffer_scale(wl->surface, wl->scaling);
wl_surface_commit(wl->surface);
configure = true;
}