diff options
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index cab1245ff4..5646c84bb7 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -225,7 +225,7 @@ static void add_feedback(struct vo_wayland_feedback_pool *fback_pool, static void get_shape_device(struct vo_wayland_state *wl, struct vo_wayland_seat *s); static int greatest_common_divisor(int a, int b); static void guess_focus(struct vo_wayland_state *wl); -static void prepare_resize(struct vo_wayland_state *wl, int width, int height); +static void prepare_resize(struct vo_wayland_state *wl); static void remove_feedback(struct vo_wayland_feedback_pool *fback_pool, struct wp_presentation_feedback *fback); static void remove_output(struct vo_wayland_output *out); @@ -880,7 +880,7 @@ static void output_handle_done(void *data, struct wl_output *wl_output) if (wl->current_output && wl->current_output->output == wl_output) { set_surface_scaling(wl); set_geometry(wl, false); - prepare_resize(wl, 0, 0); + prepare_resize(wl); } wl->pending_vo_events |= VO_EVENT_WIN_STATE; @@ -951,7 +951,7 @@ static void surface_handle_enter(void *data, struct wl_surface *wl_surface, } if (!mp_rect_equals(&old_geometry, &wl->geometry) || force_resize) - prepare_resize(wl, 0, 0); + prepare_resize(wl); MP_VERBOSE(wl, "Surface entered output %s %s (0x%x), scale = %f, refresh rate = %f Hz\n", o->make, o->model, o->id, wl->scaling, o->refresh_rate); @@ -993,7 +993,7 @@ static void surface_handle_preferred_buffer_scale(void *data, if (wl->current_output) { rescale_geometry(wl, old_scale); set_geometry(wl, false); - prepare_resize(wl, 0, 0); + prepare_resize(wl); } } @@ -1168,7 +1168,7 @@ resize: mp_rect_w(old_geometry), mp_rect_h(old_geometry), mp_rect_w(wl->geometry), mp_rect_h(wl->geometry)); - prepare_resize(wl, width, height); + prepare_resize(wl); wl->toplevel_configured = true; } @@ -1218,7 +1218,7 @@ static void preferred_scale(void *data, if (wl->current_output) { rescale_geometry(wl, old_scale); set_geometry(wl, false); - prepare_resize(wl, 0, 0); + prepare_resize(wl); } } @@ -1847,12 +1847,10 @@ static int lookupkey(int key) return mpkey; } -static void prepare_resize(struct vo_wayland_state *wl, int width, int height) +static void prepare_resize(struct vo_wayland_state *wl) { - if (!width) - width = mp_rect_w(wl->geometry) / wl->scaling; - if (!height) - height = mp_rect_h(wl->geometry) / wl->scaling; + int32_t width = mp_rect_w(wl->geometry) / wl->scaling; + int32_t height = mp_rect_h(wl->geometry) / wl->scaling; xdg_surface_set_window_geometry(wl->xdg_surface, 0, 0, width, height); wl->pending_vo_events |= VO_EVENT_RESIZE; } @@ -2039,7 +2037,7 @@ static void set_geometry(struct vo_wayland_state *wl, bool resize) if (resize) { if (!wl->locked_size) wl->geometry = wl->window_size; - prepare_resize(wl, 0, 0); + prepare_resize(wl); } } @@ -2362,7 +2360,7 @@ int vo_wayland_control(struct vo *vo, int *events, int request, void *arg) return VO_TRUE; } wl->geometry = wl->window_size; - prepare_resize(wl, 0, 0); + prepare_resize(wl); } return VO_TRUE; } @@ -2623,7 +2621,7 @@ bool vo_wayland_reconfig(struct vo *vo) if (wl->vo_opts->window_minimized) do_minimize(wl); - prepare_resize(wl, 0, 0); + prepare_resize(wl); return true; } |