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

Full layout should set the EWMH fullscreen hint #337

Closed
l29ah opened this issue May 9, 2020 · 15 comments
Closed

Full layout should set the EWMH fullscreen hint #337

l29ah opened this issue May 9, 2020 · 15 comments

Comments

@l29ah
Copy link
Contributor

l29ah commented May 9, 2020

So programs could behave accordingly, for instance mpv would enable forced vsync via EGL that would avoid video tearing.

@liskin
Copy link
Member

liskin commented May 9, 2020

Are you sure it's the EWMH hint that would make mpv not tear? In my setup, when I kill the compositor, I get some tearing when not maximized, and it's then sufficient to just maximize the mpv window for the tearing to stop. Can you point to some details, like code in mpv for example, that would support your claim? Thanks!

@l29ah
Copy link
Contributor Author

l29ah commented May 9, 2020

Yes. If i just make mpv Full, it doesn't stop tearing, but if i set the hint by hitting f in mpv before making it Full, it stops tearing.

@l29ah
Copy link
Contributor Author

l29ah commented May 9, 2020

Probably you have --fs in your mpv invocation or config?

@liskin
Copy link
Member

liskin commented May 9, 2020

No, I don't. This is my mpv config: https://github.com/liskin/dotfiles/blob/16506279fbb6455721ea61f48e6fe307f93f045d/.config/mpv/config

Do you use noBorders together with Full? The window needs to be exactly fullscreen, like what you get when you fullfloat it (withFocused $ \w -> windows $ W.float w (W.RationalRect 0 0 1 1)) in a layout with smartBorders or noBorders. Then it stops tearing here.

@geekosaur
Copy link
Contributor

geekosaur commented May 9, 2020 via email

@l29ah
Copy link
Contributor Author

l29ah commented May 22, 2020

What is the best way to have a fullscreen layout and apply the EWMH hint to the fullscreened windows then?

@l29ah
Copy link
Contributor Author

l29ah commented May 22, 2020

Do you use noBorders together with Full?

Yes, i use SmartBorders, and it tears in Full if mpv is unaware it's being fullscreened.

@liskin
Copy link
Member

liskin commented May 23, 2020

it tears in Full if mpv is unaware it's being fullscreened

The thing is that mpv shouldn't even need to be aware of it. I can reproduce the same "not tearing when exactly fullscreen, tearing otherwise" behaviour using glxgears as well if I kill the compton compositor.

It's a bit difficult to see it using glxgears so a game like neverball could be used, it's possible to switch between fullscreen and windowed.

Can you perhaps check using xwininfo that the mpv window is indeed fullscreen without borders? Paste the output here just to be sure, pls.

It's also possible that your setup is different in some other way. Mine is xorg-server 1.20.8, intel gpu with modesetting xorg driver, mesa 19.3.3.

@geekosaur
Copy link
Contributor

geekosaur commented May 23, 2020 via email

@l29ah
Copy link
Contributor Author

l29ah commented May 23, 2020

Huh, it's strange: if i don't enable --fs in mpv, the geometry in Full is different, adding an offset in Y:

xwininfo: Window id: 0xb800002 "Tearing test @60fps-0RvIbVmCOxg.mp4 - mpv"

  Absolute upper-left X:  0
  Absolute upper-left Y:  60
  Relative upper-left X:  0
  Relative upper-left Y:  60
  Width: 1920
  Height: 1080
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0xb800001 (not installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +0+60  -0+60  -0-60  +0-60
  -geometry 1920x1080+0+60

@l29ah
Copy link
Contributor Author

l29ah commented May 23, 2020

Probably xmonad doesn't want to resize my window to 1920x1200 for some mpv-mediated reason, and you're lucky to have videos of the same aspect ratio as your monitor.

@liskin
Copy link
Member

liskin commented May 24, 2020

Well that sounds like XMonad.Layout.LayoutHints :-)
Try mpv --no-keepaspect-window

@l29ah
Copy link
Contributor Author

l29ah commented May 24, 2020

Oh yeah, it doesn't tear while in Full this way.

@liskin
Copy link
Member

liskin commented May 24, 2020

So, back to the original issue: it's not the EWMH hint that needs to be set to avoid tearing in mpv. It's just that tha window needs to be actually maximized, and that can be done by having a Full without layoutHints, which is a configuration issue, not something that needs to be fixed in xmonad-contrib. I'm guessing we can close this then?

@l29ah
Copy link
Contributor Author

l29ah commented May 24, 2020

Yeah, thanks a lot, though i don't see yet how to disable it just for Full in my great https://github.com/l29ah/xmonad-config/blob/master/xmonad.hs#L230 without explosive boilerplate

@l29ah l29ah closed this as completed May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants