nclarius / KWin-window-positioning-scripts

KWin scripts controlling window placement on multi-monitor setups
GNU General Public License v3.0
59 stars 14 forks source link

Windows open on wrong screen on Wayland #11

Open koloved opened 2 years ago

koloved commented 2 years ago

Hello! https://imgur.com/ZLDsHDq.png

i had the primary 4k display , but so many apps starting on second display without any reason (as flameshot) i used your script and after that everything started using the second monitor [ { "enabled": true, "id": "unknown DP-3-unknown", "metadata": { "name": "unknown DP-3-unknown" }, "mode": { "refresh": 59.99700164794922, "size": { "height": 2160, "width": 3840 } }, "overscan": 0, "pos": { "x": 0, "y": 60 }, "primary": true, "rgbrange": 0, "rotation": 1, "scale": 2, "vrrpolicy": 0 }, { "enabled": true, "id": "unknown DP-1-unknown", "metadata": { "name": "unknown DP-1-unknown" }, "mode": { "refresh": 59.95000076293945, "size": { "height": 1200, "width": 1920 } }, "overscan": 0, "pos": { "x": 1920, "y": 0 }, "primary": false, "rgbrange": 0, "rotation": 1, "scale": 1, "vrrpolicy": 0 } ]

koloved commented 2 years ago

i am trying to understand where the problem is.. can you help ?

nclarius commented 2 years ago

Hm, at first glance I can't see what might be causing this.

  1. Which of the scripts are you using? Active, focused or primary?
  2. Which version?
  3. By "first/second monitor" you mean primary/secondary?
  4. Do you have any other KWin scripts enabled?
  5. Do you have any window rules targeting screen or position?
  6. Can you please post the output of qdbus org.kde.KWin /KWin supportInformation, section Screens?
  7. BTW, may I ask what you used to get that display information?
herzenschein commented 2 years ago

I noticed this happens with XWayland windows which attempt to force remember their positions. This is the case for mGBA and CafeTran Espresso (my main work tool) for instance.

A possible workaround is to create a window rule with the property Ignore requested geometry set to Force: Yes. This can cause issues with dialogs also following the default window placement (e.g. Maximized), but then one can disable the dialog window type.

nclarius commented 2 years ago

@herzenschein This is a plausible hypothesis and a good idea for a workaround; thank you.

@koloved, are all windows placed on the wrong screen, or only some applications?