hyprwm / Hyprland

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

Issue with Window Placement for Wine Applications on Dual Monitor Setup #2350

Open joaberg opened 1 year ago

joaberg commented 1 year ago

Steps to reproduce:

  1. Set up a dual monitor configuration in Hyprland with the following settings:

    monitor=eDP-1,1920x1080@60,860x1440,1
    monitor=desc:Samsung Electric Company C34J79x HTRMA00910,3440x1440@100,0x0,1

    I have a laptop monitor below, and a bigger monitor above. (Notice the location 860x1440)

  2. I have experimented with the following window rules for terminal.exe running through Wine: terminal.exe is the MetaTrader4 application, used for forex trading.

    windowrulev2 = float,class:^(terminal.exe)$
    windowrulev2 = nomaxsize,class:^(terminal.exe)$
    windowrulev2 = center,class:^(terminal.exe)$
  3. Disconnect the external monitor.

  4. Start terminal.exe through Wine.

Expected outcome:

The terminal.exe window should open in the center of the screen and stay there, as specified by the center window rule.

Noted outcome:

The terminal.exe window initially opens in the center of the screen, but then suddenly moves to position 0,19. The output from hyprctl clients:

Window c50d6170 -> 225008: IG-LIVE - IG Group Limited - [EURUSD,M1]:
    at: 0,19
    size: 1896,1023
    workspace: 5 (5)
    floating: 1
    monitor: 0
    class: terminal.exe
    title: 225008: IG-LIVE - IG Group Limited - [EURUSD,M1]
    pid: 95351
    xwayland: 1
    pinned: 0
    fullscreen: 0
    fullscreenmode: 0
    fakefullscreen: 0
    grouped: 0
    swallowing: 0

Additional information:

If i change monitor setting from:

    monitor=eDP-1,1920x1080@60,860x1440,1

to:

    monitor=eDP-1,1920x1080@60,0x0,1

Then i will see the window that is located at 0,19, and i can move it around etc as normal.

Suspect the issue here is in the interaction between hyprland and some wine setting.

My OS is Garuda Sway edition (Arch based)

burein-ita commented 1 year ago

This also happens with Ableton's Live dialogs.

In general, Xwayland and especially wine window management sucks under Hyprland.

If you really need to use wine I would suggest you enable Emulate a virtual desktop in wine. That is the only way I got around Hyprland's quirkyness with wine windows.

zakk4223 commented 1 year ago

Do any of the issues resolve themselves if you use xrandr to set a primary X11 display? (xrandr --output DP-1 --primary as an example)

joaberg commented 1 year ago

Do any of the issues resolve themselves if you use xrandr to set a primary X11 display? (xrandr --output DP-1 --primary as an example)

Yes that helps. (xrandr --output eDP-1 --primary) Now wine will send the window to whatever I define as primary, and disregard the active window I am starting it from.

ThomChroma commented 1 year ago

It's not a Hyprland bug, I had the same problem on Sway. The xrandr trick is the way to go to handle XWayland as long as Wine doesn't support Wayland. But it's quickly on the way 👍

joaberg commented 1 year ago

For me this is only a problem in Hyprland, Sway works just fine.

psi4j commented 11 months ago

Has anyone figured out how to make this tile in like other applications?

marco-zan commented 11 months ago

Same / similar to my problem https://github.com/hyprwm/Hyprland/issues/2856#issue-1828773609

justinvson-pd commented 9 months ago

Having the same issue with allegro free physical viewer, but not with dual monitor setup, as it happens on just my laptop screen and no other monitors connected.

I can recover by changing focus to the out of screen wine window by using my keybind for "movefocus u" and then togglefloating with another keybind, after which it will tile normally, and behaves normally.

kaibagley commented 5 months ago

I'm having a probably related issue: Using FL Studio under Wine, the windows aren't aligned with the cursor position. Unless FL is full screen, or aligned with the top of the monitor, it is difficult to align the cursor with any fields in the window.