KWin-window-positioning-scripts icon indicating copy to clipboard operation
KWin-window-positioning-scripts copied to clipboard

[Always Open on Active Screen] Windows do not actually open on active screen

Open Slater91 opened this issue 4 years ago • 10 comments

Hello! I just installed the "Always open on active screen" script. Unfortunately it does not work. If I start an application, it still opens on whatever screen it pleases instead of the one the cursor is in. I have tried restarting KWin, but to no avail. It does work, however, if I click on the desktop first.

I am using two screens, both with the same resolution and vertically arranged, on X11.

The base system is KDE Neon with Plasma 5.23.2, KDE Frameworks 5.87.0 and Qt 5.15.3.

Slater91 avatar Nov 08 '21 10:11 Slater91

Off the top of my head I don't know what could cause this, I assume some window behavior setting is incompatible with the script but I couldn't identify it in my tests.

Could you please tell me what you have in System Settings > Window Management > Window Behavior for the following settings:

  • Focus > Window activation policy
  • Focus > Multiscreen behavior > Active screen follows mouse
  • Focus > Multiscreen behavior > Separate screen focus (this option shows only when multiple screens are currently connected)
  • Advanced > Window placement
  • Advanced > Window placement > Allow apps to remember the position of their windows

Also, do you perhaps have any window rules (System Settings > Window Management > Window Rules) or other KWin scripts (System Settings > Window Management > KWin Scripts) that might override the screen preference?

And did logging out and in again not make the script work either?

nclarius avatar Nov 08 '21 16:11 nclarius

A-ha, I think I got it. I had "active screen follows mouse" disabled. Enabling it does the trick. I did not know the option was there at all, to be honest! I would suggest including this in the readme for further clarity.

Thank you for your kind help and for developing this great script, it's going to be a game changer for me! Have a great day! :)

Slater91 avatar Nov 08 '21 16:11 Slater91

Yes, of course. Thanks for making me aware of it!

Glad to hear you like the script, and thank you for the kind words. If you want to help spread the word you can leave a review in the KDE store.

nclarius avatar Nov 08 '21 16:11 nclarius

@nclarius

Focus > Multiscreen behavior > Active screen follows mouse

I have another example. Without this option GIMP 2.10.28 shows splash screen on a wrong monitor but after that actual window is placed correctly. Could you please mention it in a readme somewhere? And "this option shows only when multiple screens are currently connected" as well. It could also be set at ~/.config/kwinrc

[Windows] ActiveMouseScreen=true

Anyway, thanks for making KDE Plasma better! :+1: "Always Open on Primary Screen" works out of the box but I guess most users would prefer this ("Always Open on Active Screen") script.

xalt7x avatar Nov 27 '21 20:11 xalt7x

@Alt37 That Active screen follows mouse has to be enabled already was in the readme, or what do you mean?
That the option is only visible when several monitors are connected and the alternative route via the config file I just added, thanks for pointing it out.

nclarius avatar Nov 28 '21 00:11 nclarius

@nclarius Ah, sorry, I missed that it's actually on the github readme. Could you put this information at store.kde.org? Users which find this script via "Get New Scripts" need to now that as well. Thanks.

xalt7x avatar Nov 28 '21 00:11 xalt7x

Done.

nclarius avatar Nov 28 '21 00:11 nclarius

Hello. I am reopening this issue as I can't get windows to open on the active screen at all on my desktop, despite trying all possible settings. I am using Plasma with X11. I can't really find any pattern to the opening on the wrong screen, it seems to be entirely random.

I have checked the settings on my laptop, where the issue is not present, and they appear to be exactly the same. The laptop has version 2.1 installed and I tried using that as well on my desktop, with no luck however. I have run out of ideas on how to find the source of this problem.

Slater91 avatar Apr 30 '23 15:04 Slater91

Do you have the apps remembering positions feature turned off?

nclarius avatar May 01 '23 12:05 nclarius

Sorry, I completely missed your message! Yes, it is turned off, though that introduces other issues (e.g. the size is reset every time I close and re-open some apps, though I guess that's a bug in KWin).

Slater91 avatar Jun 11 '23 20:06 Slater91