Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong mpv floating window size and borders #3718

Closed
bitraid opened this issue Feb 18, 2019 · 6 comments
Closed

Wrong mpv floating window size and borders #3718

bitraid opened this issue Feb 18, 2019 · 6 comments

Comments

@bitraid
Copy link

bitraid commented Feb 18, 2019

This problem occurs when mpv is configured to run as a floating window.
Similar to the old #680, although version 0.15.2 worked as expected for me.
It is maybe related to #2176 and #3106

intel graphics
sway version 1.0-rc1-74-g7baaa3a0 (Feb 18 2019, branch 'master')
wlroots version 0.3-fd0b625ab
mpv version 0.29.0-134-g8b563a0346

[vo/gpu/wayland] Resizing due to xdg from 1024x768 to 665x499
[vo/gpu/wayland] Handling resize on the egl side

  • Steps to reproduce:
  1. Open the terminal.
  2. Run: mpv /usr/local/share/backgrounds/sway/Sway_Wallpaper_Blue_768x1024.png --no-config --image-display-duration=inf -v
  • Expected behavior:
    The mpv floating window should have the dimensions of the playing image/video (as it happens with version 0.15.2 and i3wm).

  • Actual behavior:
    The mpv window has a smaller size and its borders are incorrect. Furthermore, switching to the tiling area after scaling the mpv window to its either half, normal or double size (Alt+0, Alt+1, Alt+2), resets the window size. Manual resize of the window seems buggy, messes up the borders and can't increase after a certain size.

@bendooru
Copy link

The mpv window has a smaller size

If the option floating_maximum_size is unset it will default to 66% of your output's width and height, respectively, which may explain the initial wrong size and upper limit on manual resizing.

messes up the borders

Can confirm, mpv seems to always render with the initial aspect ratio, so after resizing the image/video may spill out of the container.

@emersion
Copy link
Member

Maybe related to #3593

@bitraid
Copy link
Author

bitraid commented Mar 2, 2019

Thanks for the patch, it works better now but there are still issues with resizing: mismatch window - borders size, which might also produce artifacts on the background tiling area.

@RedSoxFan
Copy link
Member

there are still issues with resizing: mismatch window - borders size, which might also produce artifacts on the background tiling area.

Can you provide more information and possibly reproduction steps and/or a screenshot?

@bendooru
Copy link

bendooru commented Mar 3, 2019

Using this minimal config

bindsym Mod4+e exit
bindsym --release Print exec grim $(date +grim_%Y-%m-%d-%H%M%S%N.png)
for_window [app_id="mpv"] floating enable

output "*" bg #ff0000 solid_color

exec mpv --no-config --gpu-context=wayland -v --image-display-duration=inf /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1136x640.png > ~/mpv-resize.log

produces the following behaviour: First resizing vertically: If a video is playing, the transparent areas seen here may become corrupted.

grim_2019-03-03-115911613870131

Then horizontally:

grim_2019-03-03-115919904185828

Logs:
sway-resize-debug.log
mpv-resize.log

Note: If using the X11 backend for mpv (e.g. --gpu-context=x11) no problems occur.

@RedSoxFan
Copy link
Member

The first screenshot is due to mpv keeping the aspect ratio constant and sending a surface smaller than the view. In this situation we just center the surface in the view. I think this is working as intended, but it is possible that it could be changed to have sway render black bars.

The second is #3029

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants