Created attachment 179052 [details] Window is larger than the screen SUMMARY When a window is maximised and then selecting full screen, when exiting full screen the previous window size is not restored. STEPS TO REPRODUCE 1. Watch video, view images, view webpages in full screen from various applications such as web browsers Chrome-based & Firefox, Gwenview, Qmplay2 2. Exit fullscreen OBSERVED RESULT The window will be too big, see attachments EXPECTED RESULT The size should be restored. SOFTWARE/OS VERSIONS Operating System: Manjaro Linux KDE Plasma Version: 6.3.2 KDE Frameworks Version: 6.11.0 Qt Version: 6.8.2 Kernel Version: 6.13.5-1-MANJARO (64-bit) Graphics Platform: Wayland Processors: 16 × AMD Ryzen 7 9700X 8-Core Processor Memory: 123.5 GiB of RAM Graphics Processor 1: NVIDIA GeForce RTX 4070 Ti SUPER ADDITIONAL INFORMATION It's possible it's been happening since at least Plasma 6.3.1 but I thought it would have been fixed since it seems so obvious. Pretty sure this bug is the same as #493401
I'm also experiencing this bug. This is happening since 6.3.0. One problem associated to this bug is that it doesn't happen every time a window is restored from fullscreen. So it's a bit difficult to properly reproduce. However it happens from time to time. And I experienced it on every computer (4) I have running KDE Plasma. I think however this is not the same as #493401.
So I did a bit of further investigation. For reproducing the bug a 100% of times, you need to use the theme Oxygen. This bug seems exclusive of the Oxygen kwin theme. And, you need to maximize the window you want to turn fullscreen before . The bug won't happen on non maximized windows that directly turn fullscreen. So, these are the steps. 1. Use Oxygen kwin theme 2. Maximize the window you want to turn fullscreen 3. Turn that window fullscreen, and then restore. This affects both X11 and Wayland. A curious thing is that if you switch the kwin theme to any other thing when a window is affected by this bug, it will recover it's normal appeareance. However, if you turn it back to oxygen, it will appear again as seen in the attachment. It may be the effect of an underlying kwin issue? Also, the kwin debug console appears always affected with this bug, with the buttons almost out of margin. Another effect of this bug is that the buttons in this state are almost unusable.
Created attachment 179137 [details] kwin debug console affected by this bug
It seems the bug https://bugs.kde.org/show_bug.cgi?id=499222 it's pretty related to this one, and the commit applied to oxygen for solving it https://invent.kde.org/plasma/oxygen/-/merge_requests/66 is what it's causing this bug.
I confirm the bug, it happens always with oxygen theme and Plasma 6.3.2.
*** Bug 501707 has been marked as a duplicate of this bug. ***
*** Bug 501070 has been marked as a duplicate of this bug. ***
(In reply to nope1000000 from comment #4) > It seems the bug https://bugs.kde.org/show_bug.cgi?id=499222 it's pretty > related to this one, and the commit applied to oxygen for solving it > https://invent.kde.org/plasma/oxygen/-/merge_requests/66 is what it's > causing this bug. I tried reverting this commit and it didn't fix the bug. In my case the simplest way to reproduce the bug is to switch window decoration to Breeze and back to Oxygen. Every window that was opened before the switch will then be affected.
Actually, the window size is correct, only the placement of buttons is wrong (window title is positioned correctly). So the problem is somewhere in Decoration::updateButtonsGeometry(). It seems that captionHeight() sometimes returns a wrong value. This patch is a quick workaround, but the real cause is likely somewhere outside Oxygen decoration. Breeze is not affected, because it doesn't use captionHeight() to calculate the position of buttons. --- a/kdecoration/oxygendecoration.cpp +++ b/kdecoration/oxygendecoration.cpp @@ -350,9 +350,9 @@ void Decoration::updateButtonsGeometry() auto s = settings(); // adjust button position - const int bHeight = captionHeight() + (isMaximized() ? s->smallSpacing() * Metrics::TitleBar_TopMargin : 0); + const int bHeight = buttonHeight() + (isMaximized() ? s->smallSpacing() * Metrics::TitleBar_TopMargin : 0); const int bWidth = buttonHeight(); - const int verticalOffset = (isMaximized() ? s->smallSpacing() * Metrics::TitleBar_TopMargin : 0) + (captionHeight() - buttonHeight()) / 2; + const int verticalOffset = (isMaximized() ? s->smallSpacing() * Metrics::TitleBar_TopMargin : 0); const QVector<KDecoration3::DecorationButton *> leftButtons = m_leftButtons->buttons(); const QVector<KDecoration3::DecorationButton *> rightButtons = m_rightButtons->buttons();
(In reply to Lukáš Turek from comment #9) > Actually, the window size is correct, only the placement of buttons is wrong > (window title is positioned correctly). So the problem is somewhere in > Decoration::updateButtonsGeometry(). It seems that captionHeight() sometimes > returns a wrong value. This patch is a quick workaround, but the real cause > is likely somewhere outside Oxygen decoration. [...] Thanks for the workaround! Successfully workarounds the issue on Debian-13 (KDE-Plasma-6.3.4). For finding the real cause: Kubuntu-24.10 with KDE-Plasma-6.1.5 seems good (working fine). https://cdimage.ubuntu.com/kubuntu/releases/24.10/release/kubuntu-24.10-desktop-amd64.iso Kubuntu-25.10 with KDE-Plasma-6.3.4 is broken. https://cdimage.ubuntu.com/kubuntu/releases/25.04/release/kubuntu-25.04-desktop-amd64.iso
It's a change introduced with Plasma 6.3. I fixed it in Klassy ( https://github.com/paulmcauley/klassy/commit/8cd4a519a9639bcfd8eba590af2a8aab8e58ebe7 ) by using borderTop when directly painting the value, and nextState->borders().top() at all other times before calling update() or setTitleBar(). Likewise, for borderLeft() and borderRight(). CaptionHeight() indirectly uses borderTop(). From updateButtonsGeometry() it needs to use nextState->borders().top()