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 763798 - No border in combobox menu
No border in combobox menu
Status: RESOLVED FIXED
Product: gnome-themes-standard
Classification: Core
Component: Adwaita GTK2 theme
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-themes-standard-maint
gnome-themes-standard-maint
Depends on: 744667
Blocks:
 
 
Reported: 2016-03-17 10:08 UTC by Maxim
Modified: 2017-07-25 08:05 UTC
See Also:
GNOME target: ---
GNOME version: 3.19/3.20


Attachments
comparsion (47.69 KB, image/png)
2016-03-17 10:08 UTC, Maxim
  Details
add 1px border to menu (2.13 KB, patch)
2016-10-25 10:17 UTC, Maxim
needs-work Details | Review
patch comparsion (52.35 KB, image/png)
2016-10-25 10:19 UTC, Maxim
  Details
Add border back to menus (1.27 KB, patch)
2017-05-03 08:28 UTC, Benjamin Bukowski
none Details | Review
combo menus in 3.24 (3.19 KB, image/png)
2017-07-25 08:03 UTC, Juraj Fiala
  Details

Description Maxim 2016-03-17 10:08:18 UTC
Created attachment 324161 [details]
comparsion

Is it possible to add a border in combobox menu like in Adwaita GTK3?
Comment 1 Juraj Fiala 2016-03-22 16:37:28 UTC
It's set for 3.22.

Although as you can see there is a border, created by the small shadow, while not perfect, it's made to simulate the gtk3 effect (for now).

The problem is all the solutions require patching mutter. We can either:
 - change the menu shadow made by mutter to create just a 1px border around it (best way, but also trickiest afaik, not sure if possible, may require adding logic to mutter)
 - stop mutter from rendering the shadow and make it with gtk2 (not as good, no transparency, breaks non-gtk2 apps)
 - make a border with gtk2 without disabling the mutter shadow (ugh)
Comment 2 Juraj Fiala 2016-03-22 16:38:40 UTC
Also, your padding is messed up. Did the font change do that? Don't tell me it's broken, I worked really hard to get it pixel-perfect.
Comment 3 Maxim 2016-03-22 22:10:36 UTC
(In reply to Juraj Fiala from comment #2)
> Also, your padding is messed up. Did the font change do that? Don't tell me
> it's broken, I worked really hard to get it pixel-perfect.

I do not know what kind of padding in question.
Comment 4 Juraj Fiala 2016-03-23 14:58:37 UTC
> I do not know what kind of padding in question.

The buttons! They're much smaller than in gtk3!
Comment 5 Maxim 2016-03-23 20:13:56 UTC
(In reply to Juraj Fiala from comment #4)
> > I do not know what kind of padding in question.
> 
> The buttons! They're much smaller than in gtk3!

Yes. It is changed by font. I'm using Roboto 9 and Adwaita GTK3 can not adapt to the font size smaller than 11pt.
Comment 6 Juraj Fiala 2016-03-23 20:17:32 UTC
GTK3 or 2? Cause that looks like a problem of 2, especially since the arrow is offset.

Also, please disregard the exclamation marks. I'm just a teeny bit enthusiastic.
Comment 7 Maxim 2016-03-23 21:37:53 UTC
(In reply to Juraj Fiala from comment #6)
> GTK3 or 2? Cause that looks like a problem of 2, especially since the arrow
> is offset.
> 
> Also, please disregard the exclamation marks. I'm just a teeny bit
> enthusiastic.

I think the problem in Adwaita gtk3. gtk2 theme looks good for me.
https://bugzilla.gnome.org/show_bug.cgi?id=761435

The buttons look the same if you choose a 11pt fonthttp://storage2.static.itmages.ru/i/16/0323/h_1458768837_3366204_e661772ddc.png
Comment 9 Juraj Fiala 2016-03-24 06:36:34 UTC
*wipes cold sweat from forehead*

Hm, also the sad thing is that I can't make the combobox look like the gtk3 one. There are like four or five different types of them, I can make most of them look great (https://www.dropbox.com/s/f8k5ujahguqqo5q/Sn%C3%ADmka%20obrazovky%20z%202016-03-24%2007-30-54.png?dl=0), I can't make that one look the same because it breaks another one.
Comment 10 Juraj Fiala 2016-10-09 07:59:17 UTC
OK unfortunately this didn't make it into 3.22. I'm going to have a look at it again soonish but again it relies on changes to mutter.
Comment 11 Juraj Fiala 2016-10-09 08:01:41 UTC
Also please look at bug #744667, which would be the first step to fix this.
Comment 12 Maxim 2016-10-25 10:17:31 UTC
Created attachment 338390 [details] [review]
add 1px border to menu

How about this patch?
Comment 13 Maxim 2016-10-25 10:19:21 UTC
Created attachment 338391 [details]
patch comparsion

Comparsion borders vs no border
Comment 14 Maxim 2016-10-27 12:34:05 UTC
Also, I saw this bug https://bugzilla.gnome.org/show_bug.cgi?id=772796

and tested patch with disabled composing/shadow.

Looks good with XFCE 
http://storage6.static.itmages.ru/i/16/1027/h_1477571479_5361182_be6f635871.png
Comment 15 Juraj Fiala 2016-10-27 13:13:27 UTC
I did actually think of doing it like this but this is the job for the adwaita engine, which can detect whether or not the current session has compositing and applies the border only as a fallback. The best way would be for mutter to make the border as a 1px shadow, like gtk3 does, but I have no idea what is happening in bug #744667.
Comment 16 Juraj Fiala 2016-10-27 19:18:19 UTC
OK so I had a talk with Lapo and he said it's better to do it this way. However this is the first patch I'm going to merge so please ignore the weird stuff I might do.
Comment 17 Juraj Fiala 2016-10-27 19:33:11 UTC
Review of attachment 338390 [details] [review]:

The patch looks good, but really it should just go into "menu". Also the drawing sections from the adwaita engine need to be removed or it'll get drawn twice for no reason.

Keep in mind both main.rc's should be identical, they are just this way because I didn't figure out a better way to make the theme install.

::: themes/Adwaita/gtk-2.0/main.rc
@@ +1538,3 @@
+    bg[NORMAL]      = @base_color
+    bg[INSENSITIVE] = @base_color
+    bg[PRELIGHT]    = @base_color

This should point to @menu_color instead. You also forgot [SELECTED] which some apps read.

But since you've overridden "menu" and set [PRELIGHT] to @base_color it would break menu item highlight in some apps that just read the format (like Firefox or Deadbeef).

@@ +1541,3 @@
+
+    engine "pixmap"
+    {

Please follow the style of the surrounding file.

@@ +1546,3 @@
+            function    = BOX
+            file        = "assets/menu-border.png"
+            border      = { 1, 1, 1, 1 }

Same here, too many aligning spaces and extra ones inside the braces, they aren't used like that anywhere else.

@@ +2522,2 @@
 # Menu and menubar items
+widget_class "*<GtkMenu>"                                          style "menu_framed_box"

We already catch GtkMenu above, why not use that? The less style matches the better (and faster).
Comment 18 Maxim 2016-10-28 09:35:36 UTC
Can you fix it?
 I'm not a developer and doesn't understand the code. Many googled before writing this patch.
 I most wanted to draw attention to a problem that can not be solved for a long time, and show that it can be solved.

For me, the problem is temporarily resolved, but for a more elegant solution, please correct it yourself.
Comment 19 Maxim 2017-02-06 10:46:22 UTC
With https://bugzilla.gnome.org/show_bug.cgi?id=744667#c39 my patch for 1px border not working. I see only shadow.
Comment 20 Benjamin Bukowski 2017-05-03 08:28:35 UTC
Created attachment 350953 [details] [review]
Add border back to menus

I have fixed it here with this change.
Comment 21 Juraj Fiala 2017-07-25 08:02:18 UTC
And now as of 3.24 thanks to the progress in bug #744667 combo menus finally have a shadow border.
Comment 22 Juraj Fiala 2017-07-25 08:03:15 UTC
Created attachment 356337 [details]
combo menus in 3.24
Comment 23 Juraj Fiala 2017-07-25 08:05:46 UTC
See bug #772796 regarding disfunctioning borders when no compositing is present.