Bug 514600 - KDecoration/KWin: incorrect display of buttons in the window titlebar due to incorrect size of the titlebar and borders
Summary: KDecoration/KWin: incorrect display of buttons in the window titlebar due to ...
Status: ASSIGNED
Alias: None
Product: kwin
Classification: Plasma
Component: decorations (other bugs)
Version First Reported In: 6.5.80
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 514255 (view as bug list)
Depends on:
Blocks:
 
Reported: 2026-01-14 15:29 UTC by Sergey Katunin
Modified: 2026-01-21 16:16 UTC (History)
5 users (show)

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


Attachments
Video contains steps to reproduce and bug itself (2.75 MB, video/webm)
2026-01-14 15:29 UTC, Sergey Katunin
Details
Bug with oxygen decoration (210.22 KB, image/png)
2026-01-14 15:29 UTC, Sergey Katunin
Details
Bug with Breeze when buttons are shifted slightly to the right (181.40 KB, image/png)
2026-01-14 15:30 UTC, Sergey Katunin
Details
Bug with Breeze decoration - extra offset to the left has been added to the right buttons (159.96 KB, image/png)
2026-01-14 15:31 UTC, Sergey Katunin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Katunin 2026-01-14 15:29:11 UTC
Created attachment 188522 [details]
Video contains steps to reproduce and bug itself

SUMMARY

On Wayland on KDE 6, buttons in the titlebar are incorrectly displayed for those themes that use the titlebar height value (`borderTop()`), for example, Oxygen. This is due to the fact that the height of the titlebar is taken for the size of the buttons, but for some reason it sometimes returns to zero (probably, the button size update event is triggered earlier than the titlebar height update event, or for some other reason), so the coordinates eventually break (see screenshot 1 - oxygen-buttons-went-higher.png).

Moreover, there is no such bug on KDE 5 + Wayland/X11, that is, it is a regression. But I do not know which version exactly.

Most likely, the problem is somewhere in the chain between KWin and KDecoration.

Also, this problem is relevant for the Breeze too, but in a slightly different scenario:

There is some kind of desynchronization of the values `borderRight()` and `borderLeft()` depending on their position `isRightEdge()` and `isLeftEdge()'.

On KDE 6 + X11 or KDE 5 + X11/Wayland, if it is `isLeftEdge()`, then the value is `borderLeft() = 0`, and if `isRightEdge()', then `borderRight() = 0`.

But on KDE 6 + Wayland, when `isRightEdge()`, then `borderRight()` may not be zero, but equal to the width of the border, which increases the width of the titlebar and eventually moves the buttons in the header to the right outside the screen. This is best seen with wide (huge) borders (see screenshot 2 - buttons-to-right.png).

And also vice versa, when the window is not `isRightEdge()` and not `isLeftEdge()` (it is located in the middle of the screen), it may be that the value of `borderLeft()` and `borderRight()` are equal to zero, which reduces the overall width of the titlebar, and thus adds extra margins to the width with the border width from the edges for these buttons (see screenshot 3 - extra-margin-to-the-left.png).

And this problem with the left and right borders does not appear on KDE 6 + X11, only on Wayland.

STEPS TO REPRODUCE

1. It is necessary to enable huge borders so that the problem is better visible.
2. Switch decorations between Breeze, Oxygen and Plastik. After switching to Oxygen, you will see that the buttons went higher that they should be.
3. Switch to Breeze decoration. Close the window, open new one, and magnify the window to the right side of the screen (`isRightEdge()`). Buttons will move to the right outside the window.

The sequence of actions is best seen in the video that I have attached.

OBSERVED RESULT

Incorrect display of buttons in the window titlebar for Oxygen and Breeze.

EXPECTED RESULT

Correct button display without extra offsets (margins).

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE neon Unstable Edition
KDE Plasma Version: 6.5.80 
KDE Frameworks Version: 6.23.0
Qt Version: 6.10.1
Comment 1 Sergey Katunin 2026-01-14 15:29:46 UTC
Created attachment 188523 [details]
Bug with oxygen decoration
Comment 2 Sergey Katunin 2026-01-14 15:30:17 UTC
Created attachment 188524 [details]
Bug with Breeze when buttons are shifted slightly to the right
Comment 3 Sergey Katunin 2026-01-14 15:31:23 UTC
Created attachment 188525 [details]
Bug with Breeze decoration - extra offset to the left has been added to the right buttons
Comment 4 Akseli Lahtinen 2026-01-15 14:59:09 UTC
I can partially repro this:

1. Breeze theme, maximize window
2. Change to Oxygen theme
3. Oxygen theme buttons are outside of view

However with Breeze I could not get the same issues as you showed, when changing back from Oxygen to Breeze.
Will still mark this as confirmed.

Operating System: KDE Linux 2026-01-15
KDE Plasma Version: 6.6.80
KDE Frameworks Version: 6.23.0
Qt Version: 6.10.1
Kernel Version: 6.18.5-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 16 GiB of RAM (15.5 GiB usable)
Graphics Processor: AMD Radeon RX 6600
Comment 5 Sergey Katunin 2026-01-15 15:12:10 UTC
(In reply to Akseli Lahtinen from comment #4)

> However with Breeze I could not get the same issues as you showed, when
> changing back from Oxygen to Breeze.

Have you tried with huge borders? This bug does not appear in 100% of cases, but when closing and opening a new window, and sometimes when the window is magnetized to the left or right edge of the screen.

You can also try switching from Breeze to Plastik and back.

If output the values of the borderRight() and borderLeft() functions to the log, I see that they sometimes return zero when they should be non-zero (border width) and vice versa. But I don't see this situation on X11, these values are always correct there for right and left borders.

Also, if it helps, I'm also reproducing the bug on KDE 6.4. As well as on hardware and on a virtual machine.
Comment 6 Marco Martin 2026-01-19 14:41:14 UTC
*** Bug 514255 has been marked as a duplicate of this bug. ***
Comment 7 Bug Janitor Service 2026-01-21 16:16:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/oxygen/-/merge_requests/76