You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
celluloid/52a7d396c846eb337ad7796fdb7...

30 lines
1.1 KiB

From 52a7d396c846eb337ad7796fdb7163e2bc208d64 Mon Sep 17 00:00:00 2001
From: gnome-mpv <gnome-mpv@nowhere>
Date: Sat, 13 Nov 2021 00:39:59 +0700
Subject: [PATCH] controller: Fix autofit triggering regardless of settings
When a video is opened for the first time, the window-scale property is
updated, triggering an autofit. Fix this by checking if window-scale is
transitioning from the value of zero, which indicates that a video is
being opened for the first time, and only requesting an autofit if this
is not the case.
Fixes #705.
---
src/celluloid-controller.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/celluloid-controller.c b/src/celluloid-controller.c
index d62ac1da..bfabfd1a 100644
--- a/src/celluloid-controller.c
+++ b/src/celluloid-controller.c
@@ -920,7 +920,7 @@ window_scale_handler(GObject *object, GParamSpec *pspec, gpointer data)
window_scale = MIN( width/(gdouble)video_width,
height/(gdouble)video_height );
- if(ABS(window_scale-new_window_scale) > 0.0001)
+ if(window_scale > 0.0 && ABS(window_scale-new_window_scale) > 0.0001)
{
celluloid_controller_autofit(data, new_window_scale);
}