Am 2017-03-19 11:08, schrieb René J.V. Bertin:
Hi,

I've mentioned an issue where the window context menus drawn by
QtCurve do not adopt a new colour palette correctly when I change a
window's or application's palette from the session default.

This happens both when I use a window or app KWin rule and when I
change the application palette in an application (e.g. KDevelop). In
the latter case the window titlebar colour changes to follow the
selected palette, so I deduce that KWin detects the change and applies
a dynamic form of an app-specific palette rule.

What happens is that the contextmenu background is not changed, only
the item (QAction) text is, but only in the contextmenus shown by
KWin. When I change the entire application palette the application's
contextmenus render correctly.

This appears to be due to some interplay between KWin and QtCurve
which I'd like to address.

3 questions that seem relevant:
- does KWin indeed handle an in-app palette change as a dynamic
app-specific palette rule?
- where in KWin's source is this rule implemented (the actual palette change)?
- is there anything that makes KWin's window contextmenus different
from other context menus in other applications?

I need to explain the whole interaction:
1. Applications can use KColorSchemeManager to set a color scheme.
2. This gets installed as a dynamic property in the QGuiApplication
3. plasma-integration reads this dynamic property and installs an X property on each created window
4. KWin reads the property and creates a QPalette from it
5. The palette gets stored for each window and is passed to the decoration and to the useractions context menu

The steps 1-3 can be replaced by a window specific rule.

The code in question is in useractions.cpp in multiple places, just search for setPalette.

Cheers
Martin

Reply via email to