Bug 413790 - Add an API for setting titlebar colors and simplify the process of customizing them for specific apps
Summary: Add an API for setting titlebar colors and simplify the process of customizin...
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: decorations (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-03 22:11 UTC by bin70086
Modified: 2019-11-24 19:21 UTC (History)
2 users (show)

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


Attachments
Dark icons on dark backgound (37.31 KB, image/png)
2019-11-03 22:11 UTC, bin70086
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bin70086 2019-11-03 22:11:34 UTC
Created attachment 123708 [details]
Dark icons on dark backgound

Currently, if the user wants to have the color scheme of the titlebar match the colors of a specific app, they have to
1) Open the app of interest
2) Open a color chooser (or install one first if needed)
3) Pick a color from the app
4) Go to Settings → Colors
5) Choose a color scheme and click Edit
6) Dig through the options to find the ones for titlebar colors
7) Edit the color scheme, click Save As and save it
8) Go to Settings → Window Management → Window Rules and click New...
9) Choose proper options for the window rule and save it.
These steps then have to be repeated for all the apps the user wants to have matching titlebar colors with.

Clearly, this process it very tedious and inaccessible for most users. In particular, it has the following obvious disadvantages:
1) The process is pretty sophisticated and is hard to discover in a way other than just seeing someone else do it (e.g. from screenshots on the Internet).
The setting ultimately has more to do with window decorations, not with rules in general (it controls the *Appearance* of apps, not the Workspace behavior). The user wants set up window decorations, so they go to window decoration settings, not to some unspecified location they have yet to discover. Moreover, the configuration for decoration themes (e.g. Breeze) already includes a tab for window-specific overrides, which further suggests to the user that all the settings for customizing the look/behavior of window decorations with specific apps. Another point is that color settings depend on the decoration chosen, as not all of them take custom color schemes into account, and the window rule will not be usable with the ones that don't.
2) The list of color schemes becomes filled with app-specific color schemes that only exist to provide titlebar colors for window rules.
3) The color scheme set by the window rule also changes colors for the titlebar menu. This is not an expected behavior and may result into bugs like the one shown in the attachment. The menu colors will also stay the same even if the user changes the main color scheme.
4) In the case of Konsole and other apps that have their own color scheme settings, the user has to edit the color scheme for the window rule every time they change colors in the app.
5) It is impossible to control transparency, nor to enable blur for the titlebar. 

SUGGESTED SOLUTION
1) Provide an API to set titlebar colors/transparency/blur.
Such API could then be used by theme engines and individual apps, and window decoration themes would then have an option to actually use the provided settings (which may or may not be enabled by default or even implemented at all).
For instance, Konsole could automatically switch titlbar colors and enable transparency+blur when the user changes corresponding settings (and Konsole already has the support for telling KWin to enable blur for the main window). It will also allow themes like Akava-Kv to provide better out-of-the-box look while not making the titlebar transparent and blurry for apps that do not have transparency+blur in their UI.
2) Move the setting for custom color schemes to the Window-Specific Overrides tab of window decoration settings.
3) In addition to being able to choose form the available color schemes, allow users to only choose the colors that affect the appearance of the titlebar, as well as to control transparency and enable blur.

Implementing this will solve the issues described above and will allow for a more beautiful and consistent look with various applications and theme engines that does not require installing pathed versions of Breeze. It will allow more apps to look good without requiring custom window rules.
Comment 1 Vlad Zahorodnii 2019-11-18 13:31:39 UTC
Hmm, I'm not sure what you by "API." There are APIs that applications can use to specify the blur region, the window opacity, and the color scheme for the server-side decoration.

Regarding blurring background behind server-side decorations, the decoration theme must specify that the background should be blurred by setting key `blur` in its metadata.

> 3) The color scheme set by the window rule also changes colors for the
> titlebar menu. This is not an expected behavior and may result into bugs
> like the one shown in the attachment. The menu colors will also stay the
> same even if the user changes the main color scheme.
As far as I know, this behavior (updating the color palette of the user actions menu) is totally intentional.
Comment 2 bin70086 2019-11-24 17:34:31 UTC
(In reply to Vlad Zahorodnii from comment #1)
> Hmm, I'm not sure what you by "API." There are APIs that applications can
> use to specify the blur region, the window opacity, and the color scheme for
> the server-side decoration.

So is it already the case that Konsole, for instance, can synchronize its titlebar colors with its internal color scheme, without requiring the user to set up a window manager rule? If so, is it limited to the list of currently istalled color schemes?

> Regarding blurring background behind server-side decorations, the decoration
> theme must specify that the background should be blurred by setting key
> `blur` in its metadata.

The decoration doesn't know by itself which apps should have their titlebar blurred. My proposal is that the apps should be able to request to blur their titlebar background.

> > 3) The color scheme set by the window rule also changes colors for the
> > titlebar menu. This is not an expected behavior and may result into bugs
> > like the one shown in the attachment. The menu colors will also stay the
> > same even if the user changes the main color scheme.
> As far as I know, this behavior (updating the color palette of the user
> actions menu) is totally intentional.
Such behavior isn't optimal because the menu is part of the general UI, not so much the titlebar. Changing colors in Konsole doesn't (and shouldn't) affect menu colors, because they are controlled by the global theme. Changing menu colors also causes a bug (shown in the attachment).
Comment 3 David Edmundson 2019-11-24 19:21:30 UTC
>So is it already the case that Konsole, for instance, can synchronize its titlebar colors with its internal color scheme,

Correct. That app has to do so though.

>The decoration doesn't know by itself which apps should have their titlebar blurred. 

Why do you need this on a per-window basis?