xmonad / xmonad-contrib

Contributed modules for xmonad
https://xmonad.org
BSD 3-Clause "New" or "Revised" License
588 stars 274 forks source link

New 17.0 ewmhFullscreen causing problems in full screen games #739

Closed jweckman closed 2 years ago

jweckman commented 2 years ago

Problem Description

The new 17.0 ewmhFullscreen syntax seems to work differently, causing issues when a 3D game is in full screen mode. Before 17.0 everything was working perfectly using this line:

handleEventHook = handleEventHook def <+> XMonad.Hooks.EwmhDesktops.fullscreenEventHook,

My attempt with extremely limited haskell understanding resulted in trying the following (based on new documentation):

defaults = ewmhFullscreen $ ewmh $ def {

It seems to work fine for regular applications like Firefox but full screen games are now exhibiting same behavior as in past versions without ewmh, namely constant flickering in certain menus and low/stuttery frames per second. The problem is exactly the same as i had before discovering the "fullscreenEventHook". To be precise, in The Hunter: Call of the Wild, i'm seeing:

I remember seeing explained somewhere that xmonad by default somehow "bounces" between windows which is normally not seen by the user, but becomes apparent when something is wrongly set up with full screen.

Am i barking at the wrong tree? Do i not know how to configure? Could be something else that was changed but pretty sure it's related since: a) using fullscreenEventHook fixed the exact same issue in the past b) fullscreenEventHook was the only thing that broke in my config when Arch moved to 0.17

Steps to Reproduce

I'm running a minimal Arch install with a fairly slimmed down xmonad config:

GPU is Nvidia GTX 1660 and CPU Ryzen 5 3600 if that matters.

Run a full screen 3D game with ewmhFullscreen enabled and there should be significantly worse performance in comparison to using fullscreenEventHook in the previous Arch major release.

If i can't get an answer to this i will have to move over to Qtile or something else, which would be sad since i otherwise really like this WM :(

Big thanks in advance for any help on this. I can provide more info in case it's needed.

Configuration File

Please include the smallest full configuration file that reproduces the problem you are experiencing:

module Main (main) where

import XMonad
import XMonad.Hooks.EwmhDesktops

main :: IO ()
main = xmonad defaults
defaults = ewmhFullscreen $ ewmh $ def {
}

Checklist

slotThe commented 2 years ago

On Thu, Jul 28 2022 12:41, jweckman wrote:

The new 17.0 ewmhFullscreen syntax seems to work differently, causing issues when a 3D game is in full screen mode. Before 17.0 everything was working perfectly using this line:

handleEventHook = handleEventHook def <+> XMonad.Hooks.EwmhDesktops.fullscreenEventHook,

My attempt with extremely limited haskell understanding resulted in trying the following (based on new documentation):

defaults = ewmhFullscreen $ ewmh $ def {

The definition of ewmhFullscreen is quite literally

ewmhFullscreen :: XConfig a -> XConfig a
ewmhFullscreen c = c { startupHook     = startupHook c <> fullscreenStartup
                     , handleEventHook = handleEventHook c <> fullscreenEventHook }

I.e., it just adds the relevant hooks for you. Right now, I fail to see how this would break anything.

I remember seeing explained somewhere that xmonad by default somehow "bounces" between windows which is normally not seen by the user, but becomes apparent when something is wrongly set up with full screen.

Not that I know, at least.

Am i barking at the wrong tree? Do i not know how to configure? Could be something else that was changed but pretty sure it's related since:

a) using fullscreenEventHook fixed the exact same issue in the past

b) fullscreenEventHook was the only thing that broke in my config when Arch moved to 0.17

Could you try to verify it's working with 0.17.0 and just using fullscreenEventHook? At the moment, the hook is just deprecated, so while you will get an xmessage prompt telling you to change it, your config will still compile and work as normal if you do use it.

jweckman commented 2 years ago

You're right, it was just a warning from the start:

xmonad.hs:334:54: warning: [-Wdeprecations]
    In the use of ‘fullscreenEventHook’
    (imported from XMonad.Hooks.EwmhDesktops):
    Deprecated: "Use ewmhFullscreen instead."
    |
334 |         handleEventHook    = handleEventHook def <+> XMonad.Hooks.EwmhDesktops.fullscreenEventHook,
    |                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Please correct them or silence using {-# OPTIONS_GHC -Wno-deprecations #-}

Using defaults = ewmhFullscreen $ ewmh $ def {} is compiling and working fine with 0.17.0-9 everywhere else except inside 3D full screen games where i get the issues that were fixed in previous versions using the FullscreenEventHook.

I have not touched my config in a long time so somewhere something must have changed during version update that makes FullscreenEventHook != ewmhFullscreen

jweckman commented 2 years ago

I just quickly tried running with my old Qtile config and i can reproduce the exact same issues there. The problem is probably elsewhere. I will ask on arch forums if anyone else is having similar problems.

Thanks for the assistance so far. I will post here if i find the culprit so others can find the solution as well. If it's Nvidia related i will know in a couple of weeks when i get my new AMD gpu

jweckman commented 2 years ago

Ok now i feel stupid. The issue is with current AUR package: proton-ge-custom-bin 1:GE_Proton7_26-1 It is flagged out of date. Using Proton experimental works just fine. For anyone else trying to debug similar things in the future i can recommend downloading some free native game like neverball to see how that works. It was working flawlessly so that made me wonder.

Big thanks @slotThe for info on the ewhm setup!