mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
26.84k stars 2.84k forks source link

Resizing bug when running inside i3 under tiled mode #3398

Closed Enzime closed 7 years ago

Enzime commented 7 years ago

mpv version and platform

mpv git-b2e5eb1 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
 built on Sat Aug  6 13:13:29 AEST 2016
ffmpeg library versions:
   libavutil       55.28.100
   libavcodec      57.48.101
   libavformat     57.41.100
   libswscale      4.1.100
   libavfilter     6.47.100
   libswresample   2.1.100
ffmpeg version: 3.1.1

Running Arch Linux 64-bit with i3 as a window manager

Reproduction steps

  1. Run i3
  2. Open a playlist with two videos of different resolutions (make sure the video player is NOT floating)
  3. Change currently playing video

    Expected behavior

  4. mpv correctly changes resolutions

    Actual behavior

  5. The black bars around the video (being a different aspect ratio to the window) no longer receive any mouse input and may change colour.

    Log files

http://sprunge.us/SdgS

Notes

From my own debugging, the issue would be fixed if I commented out the call to vo_x11_highlevel_resize inside vo_x11_config_vo_window inside video/out/x11_common.c except this would now mean that if the window was floating it no longer gets resized.

Workaround

Add keepaspect-window=no to your mpv.conf

ghost commented 7 years ago

Can you give instructions how to reproduce this under i3 default settings for someone who doesn't know how to use i3?

Enzime commented 7 years ago

If you run i3 without a config file, it will ask you to choose a modifier key (I'll say mod).

To open a terminal, you just have to press mod+Enter then you can run mpv as steps detailed in the post. Nothing else special required for reproducing this bug.

kevmitch commented 7 years ago

It seems like the OSC controls are positioned at the bottom of the real window for the first video, but later clips the controls are positioned as if the window tightly hugged the video area. I do not see the black padding bars as any color other than black though.

My guess would be that mpv's logic for resizing the window on resolution change doesn't deal with the fact that the window manager refuses to change the actual window size.

haasn commented 7 years ago

Works fine for me on xmonad, which also refuses to change the actual window size.

Enzime commented 7 years ago

@haasn I've tested on bspwm, this bug is i3 specific as far as I know.

Also, the black padding bars changing colour moreso depend on what mpv decides to change them to, on some computers it's white for me, other colours it's been the background colour in Xresources, not really sure why/how, but the area definitely becomes mouse deadzone and the colour may or may not change (the colour change if it happens is usually the easiest to notice).

ghost commented 7 years ago

So when I do this, mpv covers half of the screen, while the terminal covers the other half. The initial window size covers the entire screen half. If you change to the next video, the window appears to stay the same size, but actually the mpv window is resized down to the video rectangle. The black bars are now not drawn by mpv anymore. It looks the same, but is very different.

Some trying shows that the XSetWMNormalHints call with PAspect set causes this. Can't be our problem then.

For the record, mpv itself can deal just fine with window managers which don't honor its aspect or size hints, but i3 apparently has problems with that case.

At least this is the situation as far as I could analyze it.