Bug 461142 - Maximized windows use a different monitor to determine their bottom edge
Summary: Maximized windows use a different monitor to determine their bottom edge
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (other bugs)
Version First Reported In: 5.26.2
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen, wayland-only
: 414470 415871 434240 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-10-29 03:18 UTC by jackyguo18
Modified: 2023-09-12 17:34 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Dump of my monitor setup from KScreen. (18.85 KB, text/plain)
2022-10-29 03:18 UTC, jackyguo18
Details
Video showing the screen gap when maximizing window (3.29 MB, video/mp4)
2023-09-06 23:24 UTC, Andrew Shark
Details
Video showing the screen gap when maximizing window (2.83 MB, video/mp4)
2023-09-06 23:29 UTC, Andrew Shark
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jackyguo18 2022-10-29 03:18:36 UTC
Created attachment 153285 [details]
Dump of my monitor setup from KScreen.

SUMMARY
I have 2 monitors: a high-DPI laptop screen (BOE eDP-1-unknown) and an external monitor (Samsung LF24T35).The laptop screen is scaled by 175%. Attached is a dump from KScreen, if that is helpful.

STEPS TO REPRODUCE
1. I moved a window to the laptop screen.
2. I maximized said window.

OBSERVED RESULT
The window covers the whole width of the screen, but only covers part of the height.
I did more digging and found that if I moved the laptop screen upwards in System Settings, it would cover more of the height. I also inspected the coordinates and size of the "maximized" window. The bottom edge aligned perfectly with the top of the panel on the main monitor.

EXPECTED RESULT
The window should cover the whole laptop screen (excluding panels), as it usually should.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux 6.0.5-arch1-1
KDE Plasma Version: 5.26.2 (Wayland)
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION
Pasted below is from `qdbus org.kde.KWin /KWin queryWindowInfo` from a maximized window:
=========================================
activities: 1fe86127-d67b-4797-816f-87c2194fc798
caption: foot
clientMachine: 
desktopFile: foot
desktops: 3ecc69d2-d092-4829-89bf-f52f0f24af30
fullscreen: false
height: 496
keepAbove: false
keepBelow: false
localhost: true
maximizeHorizontal: 2
maximizeVertical: 1
minimized: false
noBorder: false
resourceClass: foot
resourceName: foot
role: 
shaded: false
skipPager: false
skipSwitcher: false
skipTaskbar: false
type: 0
width: 1289
x: 0
y: 544
Comment 1 jackyguo18 2023-03-29 23:51:46 UTC
It appears there is a very simple workaround: use kscreen-doctor to add a 1-pixel gap between the displays. Default KDE settings are not happy with this, but it works just fine.
Comment 2 Méven Car 2023-07-27 07:26:36 UTC
The kscreen output was made in X11. Could you post the output from the wayland session ?
Comment 3 Andrew Shark 2023-09-06 22:56:27 UTC
*** Bug 415871 has been marked as a duplicate of this bug. ***
Comment 4 Andrew Shark 2023-09-06 23:24:32 UTC
Created attachment 161455 [details]
Video showing the screen gap when maximizing window

I can reproduce this.

Unable to maximize window by hitting top edge if some of the monitors has panel higher than current screen panel.

Steps to reproduce:
1. Set all panels to the bottom of the screen.
2. Align all monitors by top edge.
3. Make the scale of central monitor such that the position of side monitors' panels is higher than the central monitor's panel.
4. Maximize some window by double click on its header (or by dragging on the top edge).
   In this example I use Qt Creator, because it has very well visible bottom labels.
5. Observe result.

Observed:
   The window is not fully maximized. It has gap between its bottom and a panels top.

   You can stretch it manually with Meta + rmb drag. But when you try to restore it, the window will again become "brokenly maximized". And if "restore" again from that broken state, it gets some weird size. Basically you cannot use the "normally maximized" and "normally restored" switch at the same time.

Expected:
   The window should be fully maximized.

Additional info:
If rearrange monitors so that they are aligned by bottom (there is however another bug, not allowing you to do so because of snapping, but the main thing is to keep their panels lower then central monitor panel), then the window can be fully maximized normally.
See the video demonstration.

Softwre/OS Versions:
Operating System: Arch Linux 
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10
Graphics Platform: Wayland

Monitors arrangement:
Two side monitors are FullHD, at 100% scaling. The middle monitor is UltraHD, at 180% scaling.
Comment 5 Andrew Shark 2023-09-06 23:29:03 UTC
Created attachment 161456 [details]
Video showing the screen gap when maximizing window

Sorry, the previous video is not opening (it was h265). Reuploaded.
Comment 6 Andrew Shark 2023-09-07 00:05:19 UTC
*** Bug 434240 has been marked as a duplicate of this bug. ***
Comment 7 Andrew Shark 2023-09-07 00:12:11 UTC
*** Bug 414470 has been marked as a duplicate of this bug. ***
Comment 8 Nate Graham 2023-09-11 16:47:02 UTC
*** Bug 411094 has been marked as a duplicate of this bug. ***
Comment 9 Nate Graham 2023-09-12 17:34:16 UTC
Cannot reproduce with those exact settings in Plasma 6, so it looks like it's been fixed there!