mpv icon indicating copy to clipboard operation
mpv copied to clipboard

Mpv ignores keepaspect argument when resizing with AltSnap (Fork of AltDrag)

Open rp1231 opened this issue 1 year ago • 3 comments

Important Information

Provide following Information:

  • mpv version 0.34.0-396-g2c46ae8ea3
  • Windows Version: Windows 11
  • Source of the mpv binary: Shinichiro's builds

Reproduction steps

Resize using Altsnap Hotkey action or scroll action.

Expected behavior

Resizing the window should respect the keepaspect argument

Actual behavior

Mpv ignores keepaspect argument allowing for blackbars

Extra description

Potplayer has a similar option and respects the aspect ratio when resizing with AltSnap. This issue has been mentioned in issue #6588.

rp1231 avatar Aug 08 '22 14:08 rp1231

Welp, my personal counterpoint is that I use AltSnap to resize my mpv windows with this exact purpose in mind, as in to freely resize the player window disregarding any aspect ratio settings inherited from the player or the media.

https://user-images.githubusercontent.com/11768175/183511835-7049c69e-228d-4961-bd53-4c24f8d1b329.mp4

garoto avatar Aug 08 '22 20:08 garoto

Well yeah, but you can just add --no-keepaspect and --no-keepaspect-window to the config file to disable the aspect ratio restriction.

But if you want to preserve the aspect ratio while using altsnap, there is no option that works for that. Maybe just an option like the ones referenced above can be added for restricting the aspect ratio in the altsnap use case?

rp1231 avatar Aug 08 '22 21:08 rp1231

@qmega @pavelxdd Do you guys think this is possible? Tagging you guys based on the conversation in issue #6588, as I think you guys might be knowledgeable about this.

Thanks

rp1231 avatar Aug 09 '22 11:08 rp1231

@thebombzen What does the spacebar-heating label mean?

rp1231 avatar Aug 13 '22 05:08 rp1231

It means "every change breaks someone's workflow" since it appears people use this behavior intentionally (see garoto's comment above).

Traneptora avatar Aug 13 '22 14:08 Traneptora

But if you want to preserve the aspect ratio while using altsnap, there is no option that works for that. Maybe just an option like the ones referenced above can be added for restricting the aspect ratio in the altsnap use case?

@thebombzen Ah, I see, Thanks for the explanation, but I'm asking for the addition of an extra conf option. So only people who want it can use it. If it is an opt-in conf option, it wont cause spacebar heating?

rp1231 avatar Aug 13 '22 14:08 rp1231

Can it be marked as a feature request in that case?

rp1231 avatar Aug 13 '22 14:08 rp1231

thebombzen What does the spacebar-heating label mean?

It originates from a xkcd comic: https://xkcd.com/1172/

garoto avatar Aug 20 '22 01:08 garoto

Haha ok, thanks for the link.

rp1231 avatar Aug 20 '22 06:08 rp1231

@thebombzen Are you one of the devs ? If so, hope this can be added. Thanks

rp1231 avatar Aug 23 '22 07:08 rp1231

The behavior in mpv is that the aspect is enforced only when the user manually reizes the window. Specifically, at the WM_SIZING message handler - where the application is allowed to override the size according to MS docs.

In other cases, like a 3rd party application sets the size, or Windows itself while snapping the window (e.g. with WIN+LEFT etc), mpv does not override the set size, and so the aspect might not match the video.

This is a good behavior from mpv, because otherwise two applications would "fight" over the size, and one of them is guaranteed to lose if they want different sizes. I don't think we should change it in mpv.

If you want mpv to override the size which AltSnap sets, then AltSnap needs to emulate manual user resize, specifically so that mpv sees the WM_SIZING message - where it can override the size.

avih avatar Aug 26 '22 15:08 avih

@avih I see that you've closed the issue. So I'm guessing that I don't need to paste my log now. (Based on the IRC chat)

Just wanted to mention that the behavior I'm requesting works perfectly fine in potplayer if you enable the Adjust AR to Window Size option.

So it should be possible from mpv as well?

rp1231 avatar Aug 26 '22 17:08 rp1231

So it should be possible from mpv as well?

It's not possible currently, and in my opinion it should not be possible.

avih avatar Aug 26 '22 18:08 avih

Ok

rp1231 avatar Aug 26 '22 20:08 rp1231