celluloid icon indicating copy to clipboard operation
celluloid copied to clipboard

[Feature Request] Keep window aspect ratio proportional to video AR

Open simonbru opened this issue 7 years ago • 3 comments

When resizing the window, gnome-mpv maintains the video aspect ratio by adding vertical or horizontal black bars. mpv behaves differently, the window always keeps the same shape to avoid wasting space.

Here are videos of the resizing behavior of gnome-mpv and mpv to make it more clear.

I like to have a video playing in a corner of the screen, and it is easier to find the perfect window size with mpv thanks to the way it resizes. However I don't know how difficult it is to implement, or if it could cause issues with some window managers. Maybe this could be implemented as a distinct feature triggered by a button or keyboard shortcut ? Similarly to the alt+1,2,3 shortcuts, but it would compute the window/video size based on the mouse cursor position ?

simonbru avatar Sep 09 '17 16:09 simonbru

Any update on this? I recently switched from plain mpv to celluloid and immediately noticed this behavior. A toggle like "Lock window aspect ratio" would be nice if someone doesnt like the new behavior.

saikat0511 avatar Nov 28 '21 08:11 saikat0511

Any update on this?

No. This is a bit trickier than it looks to implement in Celluloid. GTK has an API for keeping the window's aspect ratio fixed, but I'm not aware of anything for a single widget. And because we have window decorations/widgets, the aspect ratio of the window has to vary with its size for the video to maintain a fixed aspect ratio.

gnome-mpv avatar Nov 28 '21 08:11 gnome-mpv

I'm not aware of anything for a single widget

I'm not familiar at all with GTK but it sounds like Gtk.AspectFrame might do that if wrapped around the video area. Is there a known reason that wouldn't work? Otherwise I might try to put together a PR for it.

aheadley avatar Dec 18 '23 23:12 aheadley