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

Dolphin always opens on left monitor regardless of mouse pointer position #9

Closed Cris70 closed 2 years ago

Cris70 commented 2 years ago

Subject says it all. I am on openSuse Tumbleweed 20220227 (plasma v5.24.2). I have the always-open-on-active-screen kwin script installed and activated. I have no window rules at all. If you need more info I'm available.

nclarius commented 2 years ago

Could you please do the following:

  1. Update the script to the newest version
  2. Open a terminal window and enter journalctl -g "alwaysopenonactivescreen" -f > alwaysopenonactivescreen.log; don't close the terminal yet
  3. Open a Dolphin window; the window title will be logged so make sure it contains no sensitive information
  4. Go back to the terminal and press Ctrl+C; now you can close the terminal window
  5. Upload the contents of ~/alwaysopenonactivescreen.log here.

Also:

nclarius commented 2 years ago

And could you please also figure out which monitor has which screen number (0, 1, 2, ...) by investigating the output of xrandr --listactivemonitors; e.g. on my setup the left monitor is labeled 0 and the monitor on the right 1.

Cris70 commented 2 years ago

First, I updated the script using Discover. Discover told me it was updating the script from v2.6 to v2.8. However, if I go to System Settings => Window Management => KWin Scripts and click on the "i" symbol next to the script, it always reports 2.3, even after a reboot.

Next I tried to follow your instructions to gather a log. Unfortunately if I launch the command as a user, the log turns out empty. If I launch the command as root, the log only contains one line: mar 02 15:57:44 polarisuse sudo[7223]: cris : TTY=pts/0 ; PWD=/home/cris ; USER=root ; COMMAND=/usr/bin/journalctl -g alwaysopenonactivescreen -f

Regarding KWin script, I have two enabled: yours and "Latte Window Colors". Finally, I do have "Allow apps to remember the positions of their own windows" enabled.

Cris70 commented 2 years ago

And could you please also figure out which monitor has which screen number (0, 1, 2, ...) by investigating the output of xrandr --listactivemonitors; e.g. on my setup the left monitor is labeled 0 and the monitor on the right 1.

Here it is:

~ > xrandr --listactivemonitors
Monitors: 2
 0: +*DisplayPort-0 1920/521x1080/293+1680+0  DisplayPort-0
 1: +DVI-D-0 1680/434x1050/270+0+0  DVI-D-0

Monitor 0 is the right one. Monitor 1 is the left.

nclarius commented 2 years ago

First, I updated the script using Discover. Discover told me it was updating the script from v2.6 to v2.8. However, if I go to System Settings => Window Management => KWin Scripts and click on the "i" symbol next to the script, it always reports 2.3, even after a reboot.

That's odd. I don't know what the problem could be here. Things you could try:

Next I tried to follow your instructions to gather a log. Unfortunately if I launch the command as a user, the log turns out empty. If I launch the command as root, the log only contains one line: mar 02 15:57:44 polarisuse sudo[7223]: cris : TTY=pts/0 ; PWD=/home/cris ; USER=root ; COMMAND=/usr/bin/journalctl -g alwaysopenonactivescreen -f

v2.8 is what adds debug information, so if the plugin hasn't properly been updated that explains why the output is empty.

Regarding KWin script, I have two enabled: yours and "Latte Window Colors".

Ok, that shouldn't have an impact.

Finally, I do have "Allow apps to remember the positions of their own windows" enabled.

Have you tried what happens if you disable it? My understanding is that KWin scripts should override the initial placement, but with apps requesting their own position it may work differently.

Cris70 commented 2 years ago

That's odd. I don't know what the problem could be here. Things you could try:

* Uninstalling and reinstalling the script

This worked. I would like to know where does Discover thinks it installed the new releases... I'm now quite unsure about updates I took for granted :-(

Finally, I do have "Allow apps to remember the positions of their own windows" enabled.

Have you tried what happens if you disable it? My understanding is that KWin scripts should override the initial placement, but with apps requesting their own position it may work differently.

Wow, I just disabled that setting and it fixed the problem!!! I now have your script disabled, and yet the windows open where they're supposed to open. I think there must be a bug in the code that saves window positions, as I always dragged windows to my primary (right) monitor and closed them there, so they should have saved their position on the right monitor!

nclarius commented 2 years ago

That's odd. I don't know what the problem could be here. Things you could try:

* Uninstalling and reinstalling the script

This worked. I would like to know where does Discover thinks it installed the new releases... I'm now quite unsure about updates I took for granted :-(

Sorry, I don't have enough insight into how this system works. If you want ceratinty if it might affect other parts as well, you could file a bug report against Discover and hope that they know more than me.

Finally, I do have "Allow apps to remember the positions of their own windows" enabled.

Have you tried what happens if you disable it? My understanding is that KWin scripts should override the initial placement, but with apps requesting their own position it may work differently.

Wow, I just disabled that setting and it fixed the problem!!! I now have your script disabled, and yet the windows open where they're supposed to open. I think there must be a bug in the code that saves window positions, as I always dragged windows to my primary (right) monitor and closed them there, so they should have saved their position on the right monitor!

Glad to hear the problem is solved.