hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.36k stars 898 forks source link

Game: League of Legends not displaying in-game #472

Closed patrickaldis closed 1 year ago

patrickaldis commented 2 years ago

Currently, the launcher/client for the game displays fine. However the in-game window doesn't appear - game sounds are coming through so the process is active, just not displaying. I've tested on gnome under wayland and it functions as intended.

I want to try and provide more general details about the window, but I don't really have experience debugging this kind of thing - any help would be much appreciated :)

patrickaldis commented 2 years ago

I realise this has the wrong label also

vaxerski commented 2 years ago

gnome is bad for testing, as it runs on a different library. Can you try sway? Preferably sway-git.

patrickaldis commented 2 years ago

I've tried sway and sway-git and that runs it fine actually

rwendell commented 2 years ago

A quick workaround that worked for me was to:

  1. launch a different wm/de (worked with sway for me)
  2. download and install the game using any provided working method (wine-lol, snap, lutris)
  3. return to hyprland
  4. launch the game
  5. you should get an emulated windows tray, right click the riot client and select League of Legends
  6. League of Legends should pop up, but it might be a bit small, so toggle the window to floating mode/fullscreen mode

screenshot: 20221017_08h47m37s_grim

ThatOneCalculator commented 2 years ago

This actually sounds like a feature, not a bug. A compositor preventing one from running League of Legends should be seen as a positive, not a negative.

patrickaldis commented 2 years ago

I'm starting to think the same thing. 2 months clean and I can feel joy again

amilonop commented 1 year ago

I suggest using gamescope with league on Hyprland

eranikid commented 1 year ago

I'm confirming the same issue here. Let me elaborate on my findings:

First, some context: League of Legends (hereinafter LoL) consists of two separate windows: the launcher and the client. Launcher is what gets launched first, and it is a heavily customized window (e.g. it tries to handle it's own geometry and mouse drag move events, which works fine in Windows and GNOME, but completely breaks in bspwm). Launcher launches client when ready for a match, and the client is a more conventional window. As many other games, it has its own resolution setting and "Window mode" setting with three options - Fullscreen, windowed, and "Borderless window" (e.g. window without decorations). Setting mode to borderless window and resolution to equal that of the display is effectively the same as fullscreen on Windows, GNOME and bspwm.

Now to the hyprland-specific part: when client launches either in fullscreen, or borderless window with resolution equal to that of the display, situation from issue OP post takes place

The window is listed in the output of hyprctl clients as something like

    at: 0,0
    size: 1,1
    workspace: 1 (1)
    floating: 1
    monitor: 0
    ...
    xwayland: 1
    pinned: 0
    fullscreen: 0
    fullscreenmode: 0
    ...

But it's impossible to focus with neither cyclenext nor focuswindow dispatcher. It's not responding to resizewindowpixel and fullscreen dispatchers.

I believe similar issue is described in https://github.com/hyprwm/Hyprland/issues/166

It is still possible to run in regular window mode and highest available resolution, though it is a bit inconvenient - when not in hyprland-fullscreen mode, game suffers from a minor FPS dropdown, and when in hyprland-fullscreen mode, mouse pointer seems a bit off - as in when you click on { x:0, y:0 } point of the screen, the game registers click at somewhere like { x:0, y:15 }

@vaxerski you might be interested in seeing this, thanks

I'm ready to provide any diagnostic information you might want to look at

eranikid commented 1 year ago

Got an update on this.

Firstly, the issue of mouse pointer being off when WM/compositor "force-fullscreens" the window is not Hyprland specific - I also got this same behavior on bspwm.

Secondly, I discovered that launching in "Windowed mode", and then changing to "Borderless window mode" in-game actually does not make the window go 1x1, and the mouse-pointer-off issue does not apper in "Borderless window mode"

I've ran a little test and gathered some logs:

  1. I launched LoL, which was preconfigured from last launch to be 2540 x 1440 "Windowed mode". Log from before launch to getting ready for step 2
  2. I changed to 2540 x 1440 "Borderless window mode", and it rendered correctly. Log from before changing mode to getting ready for step 3
  3. I closed the window from step 2 and tried to launch LoL client again. This time, it was configured to start in 2540 x 1440 right away, and it fell into the 1x1 window trap described above. Log from before second launch

Second log file contains the line

[LOG] Map request dispatched, monitor DP-1, xywh: 0.000000 0.000000 2560.000000 1440.000000

While third one contains analogous, but different one:

[LOG] Map request dispatched, monitor DP-1, xywh: 0.000000 0.000000 1.000000 1.000000

Would be great to be able to launch LoL client in correct mode right away

vaxerski commented 1 year ago

maybe LoL is itself starting to ask its players to go outside.

gabriel-pena commented 1 year ago

I haved a same issue, but I can use fullscreen mode in-game/hyprland if i apply this rules:

windowrulev2 = size 1920 1080,class:^(league of legends.exe)$
windowrulev2 = fullscreen,class:^(league of legends.exe)$

but if a change workspace after the game is opened, i can't go back to league of legends

tienbuigia commented 1 year ago

I managed to install the game by using nested compositors with labwc and cage.

but the mouse got move fast to the corner of the screen (top-left and bottom-right) and to fix that I need to alt-tab a few times and the mouse move normally again.

I'm starting to unaddicted this game though. May try on sway in the future.

rurigk commented 1 year ago

The easiest workaround is just running lol with gamescope and select close client while on game

tienbuigia commented 1 year ago

@rurigk How do you config gamescrope in lutris? I enable gamescrope in lutris and open the game really nice but when in-game League does not take my input at all.

I only enable gamescrope and set "Gamescope game resolution" to 1920x1080, left out "Gamescrope output resolution".

rurigk commented 1 year ago

I installed league from https://github.com/kyechou/leagueoflegends Which uses wine-lol

I launch lol with gamescope -w 3840 -h 2160 -W 3840 -H 2160 -f -b -- leagueoflegends start

vaxerski commented 1 year ago

should be fixed with 7e523e4d5e526bdf5ab86a8f4fe37efeef356707 :)

ThatOneCalculator commented 1 year ago

This is so sad, now all Hyprland users will be touching even less grass than before 😔