hyprwm / Hypr

Hypr is a tiling window manager written in modern C++.
BSD 3-Clause "New" or "Revised" License
1.09k stars 33 forks source link

Wine windows render as invisible or still frames with borders #53

Open ghost opened 2 years ago

ghost commented 2 years ago

Please describe the bug Certain Wine windows do not render their content, and instead show a still frame of other content visible on the workspace. Window borders are still rendered. Can also disappear entirely at times; whilst still being visible as running processes.

Steps to reproduce: I don't expect you to install League of Legends, but as I do not run other Wine applications I don't know how widespread this is, but these issues do not exist in dwm, Gnome or Openbox for me, on the same system, and should therefore be Hypr-related rather than a problem with the Wine installation. Regardless, to reproduce:

For Windows rendering a still frame with a border

  1. Install League of Legends, for example via Lutris or this repository.
  2. Open the client. During this process you should see 1-2 wine-related windows render as a still frame showing what's behind it with a border around it (make sure to have borders enabled in Hypr).

For Windows disappearing entirely After following the previous steps queue up for a match and swap to a different workspace (leaving the client where it was). When the queue pops the client will disappear if you're not on the same workspace. If you are on the same workspace as the client it will work as expected. The client will also disappear after a match is complete, rather than showing the post-game lobby. The process is still running, but it is either not rendered at all or hidden somewhere, requiring killing the wine process for it to reappear (will of course happen next match and so on).

Expected behavior Windows rendering their content.

Screenshots This is a screenshot showing the desktop wallpaper behind a Wine window rather than its content. Notice the window borders are still rendered. 2022-04-04-183102_2558x1419_scrot

This is what it should look like: 2022-04-04-192443_1098x646_scrot

Anything else? Different states like floating or tiled or specified size/position rules do not make a difference.

Possibly useful xprop of the window pictured above:

WM_STATE(WM_STATE):
        window state: Normal
        icon window: 0x0
_NET_WM_DESKTOP(CARDINAL) = 2
_NET_FRAME_EXTENTS(CARDINAL) = 6, 6, 6, 6
_NET_WM_BYPASS_COMPOSITOR(CARDINAL) = 0
_NET_WM_STATE(ATOM) = _NET_WM_STATE_SKIP_PAGER, _NET_WM_STATE_SKIP_TASKBAR
_NET_WM_NAME(UTF8_STRING) = 
WM_ICON_NAME(STRING) = 
WM_NAME(STRING) = "hypr"
_NET_WM_ICON(CARDINAL) =    Icon (32 x 32):

WM_HINTS(WM_HINTS):
        Client accepts input or input focus: True
        Initial state is Normal State.
        bitmap id # to use for icon: 0x3200017
        bitmap id # of mask for icon: 0x3200019
        window id # of group leader: 0x3400004
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_MOTIF_WM_HINTS(_MOTIF_WM_HINTS) = 0x3, 0x24, 0x0, 0x0, 0x0
WM_NORMAL_HINTS(WM_SIZE_HINTS):
        program specified location: 1024, 612
        program specified minimum size: 512 by 216
        program specified maximum size: 512 by 216
        window gravity: Static
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x320000c
XdndAware(ATOM) = BITMAP
_NET_WM_PID(CARDINAL) = 17989
WM_LOCALE_NAME(STRING) = "en_GB.UTF-8"
WM_CLIENT_MACHINE(STRING) = "void"
WM_CLASS(STRING) = "leagueclient.exe", "leagueclient.exe"
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, _NET_WM_PING

Log: log.txt It was too long to post on pastebin.

vaxerski commented 2 years ago

That's weird, as I've used many wine apps with no issues, havent used league though... Will test.

vaxerski commented 2 years ago

Can't reproduce, all of my wine games and programs (tested: photoshop, homm5, civ4, civ5, terraria, hyperdimension neptunia) work properly. Have you tried changing the window's size when it goes blank?

ghost commented 2 years ago

Blank window resizing: 1

As for the 'invisible' ones I've discovered that if I can locate it and move/drag the window, it will become visible again. Does not work with the blank ones though.

vaxerski commented 2 years ago

As for the 'invisible' ones I've discovered that if I can locate it and move/drag the window, it will become visible again. Does not work with the blank ones though.

Yeah this one makes sense, some windows do that and I've yet to find out why (my example is always ario)

with the blank ones I don't know what's causing this. The app itself should spew errors if that happens though, have you tried launching it from a terminal and seeing the output?

ghost commented 2 years ago

I had a look at the wine logs but to be honest interpreting them is a bit beyond my scope.

I realize this entire issue is difficult to troubleshoot when there are no direct log entries and you're not able to reproduce it in your wine applications, so if you want to close this that's fine.

Ideally someone else would report their experience with League of Legends and Hypr so we could rule out my setup being the cause.

ghost commented 2 years ago

I'm experiencing similar issues however I have achieved a somewhat usable setup with the following rules in hypr.conf:

windowrule=float,class:leagueclientux.exe
windowrule=size 1286 726,class:leagueclientux.exe
windowrule=workspace 2,class:leagueclientux.exe
windowrule=move 650 360,class:leagueclientux.exe

windowrule=float,class:explorer.exe
windowrule=size 0 0,class:explorer.exe
windowrule=workspace 2,class:explorer.exe
windowrule=move 650 360,class:explorer.exe

windowrule=float,class:riotclientux.exe
windowrule=size 1286 726,class:riotclientux.exe
windowrule=workspace 2,class:riotclientux.exe
windowrule=move 650 360,class:riotclientux.exe

windowrule=workspace 2,class:league of legends.exe

With this windows will spawn floating and in their correct sizes preventing odd rendering issues when Hypr attempts to tile them. It is not sufficient to set it to floating as this results in a ~20x40px window.

There are still odd problems which do not arise in other WMs.

  1. All in-game video modes (i.e. borderless, fullscreen, windowed) behave poorly.

Assigning a fullscreen window rule in Hypr's config does not solve these issues. The somewhat workable solution is to use borderless and either continue to switch back and forth between workspaces until it fixes itself or toggle Hypr's full-screen setting on and off. Not ideal but at least you don't have to restart the game.

  1. As OP described the client is still invisible after closing the main game. If you find its space and attempt to move it you can sometimes make it render. Video.

Unfortunately I do not know what is causing these issues to arise in Hyper but not other WMs.

vaxerski commented 2 years ago

videos are broken for me (cant play them), but nevertheless all of this seems to arise from some miscommunication issue between hypr and Xorg (damn it, xorg!), where windows do not get their initial size and pos (state) correctly applied.

I can reproduce the partially visible bug on fullscreen with vlc, although moving the mouse over the invisible area fixes it. It's been annoying me for ages, but I have no idea either on what causes it.

I might try to see if I'm missing something - If you say it works on other WMs, I'll try spectr and bsp

Fullscreen mode results in other workspaces being non-interactive and maintaining the League cursor.

I have suspicions this is partially due to Xorg being Xorg - does this happen on, say, dwm?

ghost commented 2 years ago

videos are broken for me (cant play them).

Seem to be broken for me too. Opening their links with mpv e.g. mpv https://user-images.githubusercontent.com/102994494/164995159-77de14ea-489a-49ac-8e73-9af7d997c1af.mp4seem to work.

I can reproduce the partially visible bug on fullscreen with vlc, although moving the mouse over the invisible area fixes it. It's been annoying me for ages, but I have no idea either on what causes it.

Does not work with League as moving the cursor to the edge of the screen moves the camera (I do move the cursor there in the video).

I have suspicions this is partially due to Xorg being Xorg - does this happen on, say, dwm?

Yes this is entirely possible. Since borderless is the go-to setting when it works I have not tried fullscreen in other WMs. I will fire up bsp and check.

ghost commented 2 years ago

I have suspicions this is partially due to Xorg being Xorg - does this happen on, say, dwm?

You are correct. This one occurs on bspwm and leftwm as well. The others do not.

vaxerski commented 2 years ago

ok. will look into.

vaxerski commented 2 years ago

partially visible fullscreen fixed in 8bad02d1155bcbc83a6f7fe6a6ed71c53febd3c2

ghost commented 2 years ago

partially visible fullscreen fixed in 8bad02d

Can confirm. League no longer cuts off parts of the screen. Thanks!