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 761870 - calling gtk_style_context_save on a menuitem style child of a menubar makes it not render
calling gtk_style_context_save on a menuitem style child of a menubar makes i...
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: .General
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-02-11 17:38 UTC by Caolan McNamara
Modified: 2018-04-15 00:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
adds a menubar example to gtk-demo which reproduces a gtk_style_context_save problem (2.49 KB, patch)
2016-02-11 17:38 UTC, Caolan McNamara
none Details | Review

Description Caolan McNamara 2016-02-11 17:38:16 UTC
Created attachment 320898 [details] [review]
adds a menubar example to gtk-demo which reproduces a gtk_style_context_save problem

Which sounds like bug 758442, but this is with today's gtk master from git which claims to have that fixed.

Attached is a patch against gtk-demo to add a menubar example which reproduces this problem (this is probably the reason firefox in current f24 has no box-shadow in its menus anymore)
Comment 1 Matthias Clasen 2016-02-12 01:41:49 UTC
To be clear: the fix was to the foreigndrawing example. So for it to help in firefox, the Firefox copy of the code needs to be updated. 

Thanks for the example/test case anyway, I will have a look.
Comment 2 Matthias Clasen 2016-02-12 04:32:04 UTC
Quick initial analysis:

style_context_save() creates a subnode of the context's node, by copying it. So you end up with a tree that looks like this:

menubar > menuitem:hover > menuitem:hover

Unfortunately, Adwaita only styles menubar > menuitem:hover, which we don't match anymore.

So, using save() can have unintended side-effects. We're still discussing if there's a good way to fix this.
Comment 3 Michael Catanzaro 2016-03-03 00:05:01 UTC
This would be a good one to "fix" somehow. This explains several strange problems I never solved when attempting to use the foreign drawing API.

I think Benjamin mentioned months ago possibly using some bit to track whether a node was created by save()?
Comment 4 Benjamin Otte (Company) 2016-03-03 00:09:09 UTC
There's no way to track that inside CSS though.

And you don't want to match any menuitem that's a descenant of a menubar, because those aren't just menuitems inside menuitems (your extra save()) but also menuitems inside menus popped up by the menubar.

And this code is written to explicitly not style the second case.
Comment 5 Matthias Clasen 2016-03-03 13:16:24 UTC
the fix is to not use gtk_style_context_save
Comment 6 Matthias Clasen 2018-02-10 05:06:48 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
Comment 7 Matthias Clasen 2018-04-15 00:28:03 UTC
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla.

If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab:

https://gitlab.gnome.org/GNOME/gtk/issues/new