This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Window positioning issues with multiple monitors

Tags: None
(comma "," separated)
meyertime
Registered Member
Posts
2
Karma
0
Greetings KDE community! Since this is my first post, I thought I would introduce myself a little bit first. If you don't care, you can skip this paragraph. I write code for a living, and I've used every version of Windows since 3.11. Windows 95 was about the peak of greatness; every version since then has ruined one thing or another and gradually made life more and more difficult for those of us who know what we're doing on a computer and care about performance and privacy. Recently, my dislike of Windows hit critical mass, and I finally made the switch to Linux desktop for personal about 1.5 years ago and work .5 years ago. I'm using Arch Linux and Plasma and loving it. I try to chronicle all the things I figure out here so I don't forget them: https://github.com/meyertime/linux-all-the-things

I use 2 external 4k monitors along with my laptop's built-in 4k monitor. Yeah, I'm spoiled... The global scale factor is 150%. (The laptop monitor is set to a lower resolution, 2880x1620, as an easy way to match DPIs with the external monitors, but this doesn't appear to affect the issue that I'm having.) I've managed to figure out just about every scaling issue I've run into, but there's one pesky issue that I just don't know enough about Plasma to troubleshoot any further. I'm looking for some guidance.

So I have the two external monitors next to each other and the laptop monitor centered between them underneath. The right external monitor is "primary" and has the taskbar. The issue is when I maximize windows on the primary monitor that has the taskbar, the window only takes up the top half of the screen. KWin (I'm assuming, since I think it's the window manager?) seems to think that this is the only available area for any windows, because if I drag to the side to have it take up a half or quarter of the screen, it also stays inside that top half area. Now, I can drag windows outside that area (usually). I can manually size it to the full screen, just not by maximizing it. So it's just a pain. A related issue is that the application launcher does not show up where it should right above the taskbar. Instead, it appears somewhere else on the screen. KWin seems to treat it like any other window and try to find some unoccupied space (usually in the top half) to put it.

Here's what I've learned so far in my troubleshooting:
  • If I turn off the laptop monitor, the problem is fixed, so it may have something to do with the fact that there is another screen below the taskbar.
  • I've experimented and reproduced the issue with the two external monitors by positioning them one below the other with the one above primary. I've also reproduced it this way at 1080p instead of 4k. So the resolution does not seem to matter, and it happens even if the two monitors are the same resolution.

Some other information that may be pertinent:
  • Lenovo P50 laptop
  • I am still using X11, not Wayland.
  • I am using the proprietary NVIDIA drivers along with optimus-manager which is set to NVIDIA mode by default, since it's required to get all the external ports to work.
  • Arch Linux, so everything is the latest version as of today.
  • I have turned off KScreen, because I've found xrandr to be extremely finicky. The scripts I wrote specifically to get the multiple 4k setup working don't even work super consistently. If things aren't done exactly right, or if xrandr is just feeling grumpy that day, I'll get a BadMatch error on RRSetScreenSize, and the 3-monitor setup won't work again until I reboot. KScreen doesn't have a chance and will interfere with things when unplugging or plugging in monitors.

So the steps to reproduce would be:
  1. Set up 2 monitors so that one is below the other.
  2. Make the top monitor primary.
  3. Try maximizing a window in the top monitor.
  4. If you don't see what I'm talking about, try making the bottom monitor primary and then the top monitor primary again. (Sometimes if the stars align, it work work for me, but then if I switch primary monitors, the issue will appear.)
  5. If you still don't see what I'm talking about, try all the above steps using only xrandr commands (no GUI) and KScreen background service turned off.

Has anyone else ran into this issue before? What am I missing? Should I open a bug report?
patpat
Registered Member
Posts
2
Karma
0
*bump*
https://bestparentalcontrolapps.com/spyzie/
I think this issue is pretty common. Hope more people will see this thread and help you to solve this problem.

Last edited by patpat on Tue Aug 04, 2020 10:42 am, edited 1 time in total.
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
Well if it is so common, speak up, reproduce it test and report your findings.

I can't as I have no way of adding a second external monitor to my laptop, I do not have a NVIDIA graphic card (which BTW is the cause of many problems unter Linux due to the bad Linux support by the manufacturer), and I do run a different Linux distribution and different Plasma version.

Keep in mind that this is a volunteer driven forum, if somebody has the same setup and has time to test they will, it is just not something happening that fast.


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
User avatar
ladycristal
Registered Member
Posts
1
Karma
0
OS
I had this very same issue, but in my case the layout is horizontal: the second screen is align to the right of the laptop screen.

Somewhere in Reddit after googling the issue, saw that someone suggested to move the second screen some pixels up or down in relation to the primary screen (laptop screen). And it did it, all windows in the second screen became full screen, no more "phantom bar".

But... I couldn't move the second screen just a couple of pixels, it jumped 138px down, and that difference made the moving from one screen to the others less smooth, had issues while moving the mouse point through the upper side of the screen.

Just now, after googling again, found another solution: In this case the user suggested to move the second screen around, then apply, then align the second screen again with the main screen and then apply. And it worked. Right now I have both screen with full size windows and moving from one to another in the upper side is not longer an issue.

____________________________________________________________________________________________________________
Using Kubuntu 20.10, KDE Plasma Version 5.19.5, KDE Framework Version 5.74.0, QT Version 5.14.2
meyertime
Registered Member
Posts
2
Karma
0
Thanks, ladycristal, for the reply! Those are good suggestions that I had not tried before. However, they did not work for me unfortunately. I even tried as much as 300px between screens.

Does anyone know where the code is that actually determines the zones where windows can go? I'd be willing to dive in and try fixing it myself if I had an idea of where to start.
kylemd
Registered Member
Posts
1
Karma
0
Thought I'd reply to this as I couldn't find the answer myself - the position settings are saved in
Code: Select all
./.config/systemsettingsrc


Here's mine:

Code: Select all
[MainWindow]
HDMI-A-0 DP-1-0 Window-Maximized 1080x1920=true
HDMI-A-0 DP-1-0 XPosition 1920x1080=438
HDMI-A-0 DP-1-0 YPosition 1920x1080=260
HDMI-A-0 eDP DP-1-0 Window-Maximized 1920x1080=true
MenuBar=Disabled
RestorePositionForNextInstance=false
State=AAAA/wAAAAD9AAAAAAAAA/wAAAK8AAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAEAAAAWAG0AYQBpAG4AVABvAG8AbABCAGEAcgAAAAAA/////wAAAAAAAAAA
ToolBarsMovable=Disabled
eDP HDMI-A-0 DP-1-0 Window-Maximized 1920x1080=true
eDP HDMI-A-0 XPosition 1920x1080=1920
eDP HDMI-A-0 YPosition 1920x1080=29
eDP Height 1920x1080=671
eDP Width 1920x1080=1020
eDP Window-Maximized 1920x1080=true
eDP XPosition 1920x1080=900
eDP YPosition 1920x1080=365


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell