Bug 483994 - kwin: wrong window size after disabling external monitor
Summary: kwin: wrong window size after disabling external monitor
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.10
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-19 12:53 UTC by Horst Schirmeier
Modified: 2024-03-19 12:57 UTC (History)
0 users

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


Attachments
Firefox showing button at viewport bottom right (before disabling ext. monitor / after applying workaround) (139.11 KB, image/png)
2024-03-19 12:53 UTC, Horst Schirmeier
Details
Firefox showing button at viewport bottom right (after disabling ext. screen), actually rendering it behind taskbar (134.91 KB, image/png)
2024-03-19 12:54 UTC, Horst Schirmeier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Horst Schirmeier 2024-03-19 12:53:20 UTC
Created attachment 167466 [details]
Firefox showing button at viewport bottom right (before disabling ext. monitor / after applying workaround)

SUMMARY
After enabling ("Extend to right") and again disabling an external monitor, applications get the wrong impression what the current vertical viewport size actually is, although the screen resolution seems right. For example, a maximized Firefox window displaying a website with a button at the "bottom" of the current viewport does not show the button in the right place anymore, but at an even lower position behind the Plasma taskbar (see attached screenshots). Similarly, a maximized Konsole terminal shows its bottom-most text line behind the Plasma taskbar.

As a workaround, switching screen resolutions back and forth fixes the problem temporarily, until again an external monitor is involved:

xrandr --screen 0 --size 1680x1050
sleep 1
xrandr --screen 0 --size 1920x1080

STEPS TO REPRODUCE
1. Attach external monitor via HDMI that has a higher resolution (here: 2560x2880) than the primary monitor (here: 1920x1080)
2. Enable external monitor, "Extend to right"
3. Start a Konsole terminal, maximize on primary monitor, repeatedly press ENTER to reach the bottom terminal line
4. Disable external monitor, "Switch to laptop screen"

OBSERVED RESULT
Bottom terminal line (and cursor) isn't visible anymore but "behind" the Plasma taskbar

EXPECTED RESULT
Bottom terminal line (and cursor) should be visible right above the Plasma taskbar

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.27.10 (Debian testing: 4:5.27.10-3)
KDE Frameworks Version: 5.107.0
Qt Version: 5.15.10
Comment 1 Horst Schirmeier 2024-03-19 12:54:16 UTC
Created attachment 167468 [details]
Firefox showing button at viewport bottom right (after disabling ext. screen), actually rendering it behind taskbar
Comment 2 Horst Schirmeier 2024-03-19 12:57:54 UTC
Website for reproducers: https://www.w3schools.com/css/tryit.asp?filename=trycss_position_fixed
(the Konsole variant is even easier to reproduce)