After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 761476 - Set _GTK_THEME_VARIANT property also for light/normal theme variant
Set _GTK_THEME_VARIANT property also for light/normal theme variant
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-02-02 21:51 UTC by Alberts Muktupāvels
Modified: 2016-02-04 10:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdkwindow-x11: always set _GTK_THEME_VARIANT property (1.14 KB, patch)
2016-02-04 10:22 UTC, Alberts Muktupāvels
committed Details | Review

Description Alberts Muktupāvels 2016-02-02 21:51:37 UTC
Currently _GTK_THEME_VARIANT property is set only if theme variant is dark, otherwise property is removed. Please consider setting this property always even when theme variant is light/default.

The problem is that currently there is no way to detect if window does not support theme variants or light theme variant is requested.

There is at least one case where this can be considered as bug:
1) User has enabled Global Dark Theme
2) User has set GNOME Terminal to use light theme variant
3) Mutter shows dark theme decoration, but window itself use correct - light theme variant.

It would be nice if it could work like this:
1) If windows does not have _GTK_THEME_VARIANT - window manager can use default theme variant - light or dark if it is enabled globally (in settings.ini)
2) If property is set - then use variant based on value it has. empty string should be considered as light/normal theme variant.

diff for gdkwindow-x11.c:
-  gdk_x11_window_set_utf8_property (window, "_GTK_THEME_VARIANT", variant);
+  gdk_x11_window_set_utf8_property (window, "_GTK_THEME_VARIANT",
+                                    variant ? variant : "");
Comment 1 Matthias Clasen 2016-02-03 06:54:52 UTC
The culprit here is 'global dark theme' - somebody decided that was cool to add without thinking through the consequences. It doesn't fit in the original design for how dark themes are meant to work.
Comment 2 Alberts Muktupāvels 2016-02-03 07:35:01 UTC
That is why I wrote 'can be considered as bug' not 'it is bug'. Still it would be nice if it would be possible to make it work.

Do you think that setting this property to empty string is something wrong and/or can cause major problems?
Comment 3 Matthias Clasen 2016-02-04 09:09:19 UTC
I think setting the property to the empty string is ok
Comment 4 Alberts Muktupāvels 2016-02-04 10:22:46 UTC
Created attachment 320414 [details] [review]
gdkwindow-x11: always set _GTK_THEME_VARIANT property

Set _GTK_THEME_VARIANT to empty string when default theme variant
is used. This will allow to understand whether _GTK_THEME_VARIANT
is not supported or default variant is requested.
Comment 5 Alberts Muktupāvels 2016-02-04 10:23:18 UTC
(In reply to Matthias Clasen from comment #3)
> I think setting the property to the empty string is ok

Thanks! Can I push attached patch?
Comment 6 Matthias Clasen 2016-02-04 10:28:38 UTC
Review of attachment 320414 [details] [review]:

ok
Comment 7 Alberts Muktupāvels 2016-02-04 10:30:02 UTC
Thanks!