Bug 465621 - Allow to modify titlebar buttons (decorations)
Summary: Allow to modify titlebar buttons (decorations)
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: scripting (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-12 11:42 UTC by Plata
Modified: 2023-05-19 13:08 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Plata 2023-02-12 11:42:27 UTC
SUMMARY
I would like to influence the following from kwinrc via KWin script:

[org.kde.kdecoration2]
ButtonsOnRight=
Comment 1 Natalie Clarius 2023-02-13 15:18:11 UTC
This can already be achieved with a custom window decoration. What is the use case for modifying the option in a KWin script?
Comment 2 Plata 2023-02-13 18:45:43 UTC
(In reply to Natalie Clarius from comment #1)
> This can already be achieved with a custom window decoration. What is the
> use case for modifying the option in a KWin script?

I wrote this: https://store.kde.org/p/1985909. The problem is that apps with CSD do not care about the noBorder and still draw the titlebar buttons inside the window. So I would like to remove the buttons from the decoration completely. However, the buttons must be shown if the window is moved to the external screen. Therefore, I cannot use custom window decoration (or am I missing something?).
Comment 3 Natalie Clarius 2023-02-13 18:54:25 UTC
But how setting the buttons for KDecorations help for apps that don't use them and will draw their own buttons anyway?
Comment 4 Plata 2023-02-13 18:58:34 UTC
If I remove the buttons from System Settings, it works. The assumption was that it would behave the same way in the KWin script. But yes, that might be naive if System Settings has a separate way to ensure consistency in GTK apps (don't know how it's implemented).
Comment 5 Natalie Clarius 2023-02-13 19:04:15 UTC
Ah, you're right, it does actually affect CSDs too. Ignore my previous comment then, sorry.
Comment 6 Plata 2023-05-19 13:08:33 UTC
Alternatively to adding many things individually to the scripting API, there could be one function to use kwriteconfig5 or even run a shell script. The latter would be very powerful but might have security implications.