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 710909 - Buttons are cut in some windows
Buttons are cut in some windows
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 711343 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-10-26 08:28 UTC by Satyajit Sahoo
Modified: 2016-04-05 23:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Cut buttons in Gnome Screenshot in Cinnamon (75.61 KB, image/png)
2013-10-26 08:28 UTC, Satyajit Sahoo
Details
Shutdown Dialog - Cinnamon (1.19 MB, image/png)
2013-11-10 00:20 UTC, Claire Farron
Details
Open FIle Dialog - Cinnamon (720.65 KB, image/png)
2013-11-10 00:21 UTC, Claire Farron
Details
Cinnamon Settings - Cinnamon (720.35 KB, image/png)
2013-11-10 00:22 UTC, Claire Farron
Details
pkexec Authentication Dialog (678.24 KB, image/png)
2013-11-10 00:24 UTC, Claire Farron
Details
Interactive GNOME screenshot 1 (353.15 KB, image/png)
2013-11-12 21:42 UTC, Claire Farron
Details
Interactive GNOME screenshot 2 (836.61 KB, image/png)
2013-11-12 21:44 UTC, Claire Farron
Details
gnome-screenshot (28.02 KB, image/png)
2013-11-13 01:39 UTC, Matthias Clasen
Details
picture of bad buttons (42.34 KB, image/png)
2014-02-13 16:36 UTC, Allin Cottrell
Details
with non-homogeneous buttons (42.39 KB, image/png)
2014-02-13 17:58 UTC, Allin Cottrell
Details
Buttons cut from sides in GTK dialogs (548.70 KB, image/png)
2014-02-21 17:38 UTC, Satyajit Sahoo
Details
Minimal test case (2.14 KB, text/plain)
2014-03-04 16:38 UTC, Allin Cottrell
Details

Description Satyajit Sahoo 2013-10-26 08:28:46 UTC
Created attachment 258156 [details]
Cut buttons in Gnome Screenshot in Cinnamon

The buttons are cut from below in some windows in various applications. This occurs with Adwaita and also various other themes like Greybird, Numix etc. I've attached a screenshot with

Here are some more screenshots in a bug report on Greybird - https://github.com/shimmerproject/Greybird/issues/41
Comment 1 Satyajit Sahoo 2013-10-26 08:30:16 UTC
Though I think this is an application specific issue rather than in GTK+, I'm not sure.
Comment 2 Matthias Clasen 2013-11-09 05:22:55 UTC
*** Bug 711343 has been marked as a duplicate of this bug. ***
Comment 3 Claire Farron 2013-11-09 09:43:47 UTC
I'll post here in 12 hours time what I have in Cinnamon, but you can see the referenced bug in the above comment, which shows you aren't alone here.
Comment 4 Claire Farron 2013-11-10 00:20:19 UTC
Created attachment 259391 [details]
Shutdown Dialog - Cinnamon

Shutdown Dialog - Cinnamon
Comment 5 Claire Farron 2013-11-10 00:21:12 UTC
Created attachment 259392 [details]
Open FIle Dialog - Cinnamon
Comment 6 Claire Farron 2013-11-10 00:22:12 UTC
Created attachment 259393 [details]
Cinnamon Settings - Cinnamon
Comment 7 Claire Farron 2013-11-10 00:24:05 UTC
Created attachment 259394 [details]
pkexec Authentication Dialog

As you can see in my pictures, I also have buttons which have the bottoms cut off in Cinnamon with GTK 3.10. These are taken in ArchLinux.
Comment 8 Claire Farron 2013-11-12 21:42:33 UTC
Created attachment 259698 [details]
Interactive GNOME screenshot 1

With update to gtk3.10.3-1 in ArchLinux:
Shutdown Dialog now fine.
Open Dialog now fine.
Cinnamon Startup Application Preferences now fine.
pkexec Authentication Dialog now fine.

However, Interactive GNOME screenshot still playing up (this is one of two).
Comment 9 Claire Farron 2013-11-12 21:44:38 UTC
Created attachment 259699 [details]
Interactive GNOME screenshot 2

With update to gtk3.10.3-1 in ArchLinux, second of two screenshots.
Comment 10 Matthias Clasen 2013-11-12 23:34:36 UTC
that does not really look like gnome-screenshot. There's an extra black title up top, 'Screenshot' - where does that come from ?
Comment 11 Claire Farron 2013-11-13 00:08:47 UTC
Matthias, that is gnome-screenshot, in interactive mode, in Cinnamon 2.0.10 on ArchLinux.
Comment 12 Matthias Clasen 2013-11-13 01:39:54 UTC
Created attachment 259706 [details]
gnome-screenshot
Comment 13 Matthias Clasen 2013-11-13 01:42:42 UTC
Here is a screenshot of gnome-screenshot on my system - notice the absence of that black bar with the label 'Screenshot'. I don't know what adds that on your system, and I'm somewhat suspicious that it may push the content down just far enough to cut the buttons off.
Comment 14 Matthias Clasen 2013-11-13 01:44:09 UTC
oh, I know - thats the fallback app menu - is it not ?
Comment 15 Matthias Clasen 2013-11-13 01:46:07 UTC
indeed, I've reproduced it now.
Comment 16 Claire Farron 2013-11-20 23:01:34 UTC
Latest update to gnome-screenshot on ArchLinux with Cinnamon resolves issue.
Comment 17 Simon Steinbeiss 2014-01-31 01:20:22 UTC
I'd like to ask you to re-open this bugreport. I can reproduce the issue with the cut buttons with all themes that use the default gtk engine, in Ubuntu using 3.10.7-0ubuntu1.

Themes using other engines (i.e. Adwaita) or svg assets don't have that problem.

As far as I can tell, only GtkDialog is affected.

I can also submit a new bugreport for this problem, but at least the symptoms seem to be the same.
Comment 18 Edoardo Maria Elidoro 2014-02-06 07:16:30 UTC
I can confirm that this bug is still present with GTK3 3.10.7. I found it on my Archlinux + GNOME install using Numix as theme and I can reproduce it on Archlinux + Xfce using Greybird as theme.

Please, re-open this since it's far away from being fixed.
Comment 19 Allison Karlitskaya (desrt) 2014-02-13 11:42:54 UTC
fwiw, I can't reproduce this with Gtk out of git.
Comment 20 Simon Steinbeiss 2014-02-13 13:51:28 UTC
@desrt: I presume you didn't test with Adwaita but with a theme that uses only the default gtk engine?
Comment 21 Allison Karlitskaya (desrt) 2014-02-13 13:56:43 UTC
I used adwaita.
Comment 22 Edoardo Maria Elidoro 2014-02-13 13:59:20 UTC
(In reply to comment #21)
> I used adwaita.

Can you please try with Greybird as theme?
What application did you tried to tell that you can't reproduce the bug?
Comment 23 Simon Steinbeiss 2014-02-13 14:07:56 UTC
@des(In reply to comment #21)
> I used adwaita.

Yeah, as I mentioned above it's not reproducible with Adwaita or Ambiance (unico-engine). This is a problem with Gtk3.10, GtkDialog and the default gtk engine.
Comment 24 Allison Karlitskaya (desrt) 2014-02-13 15:01:22 UTC
I also don't see the problem with the default theme.
Comment 25 Satyajit Sahoo 2014-02-13 15:41:32 UTC
(In reply to comment #24)
> I also don't see the problem with the default theme.

No, not the default theme. Simon is referring to the built in engine i.e. not adwaita engine.

Greybird, Numix etc use the built in GTK3 engine and the button borders are drawn by CSS unlike Adwaita, where they are drawn by SVG assets.
Comment 26 Emmanuele Bassi (:ebassi) 2014-02-13 16:00:53 UTC
> (In reply to comment #24)
> > I also don't see the problem with the default theme.
> 
> No, not the default theme. Simon is referring to the built in engine i.e. not
> adwaita engine.

that's what "default theme" means.
 
> Greybird, Numix etc use the built in GTK3 engine and the button borders are
> drawn by CSS unlike Adwaita, where they are drawn by SVG assets.

given that two different themes do not expose this issue, are you sure this isn't a bug in the Numix and Greybird theme engines, instead?

in any case, don't change to VERIFIED INCOMPLETE.
Comment 27 Simon Steinbeiss 2014-02-13 16:04:02 UTC
(In reply to comment #26)
> given that two different themes do not expose this issue, are you sure this
> isn't a bug in the Numix and Greybird theme engines, instead?

Just to keep things clear, Numix and Greybird don't have "theme engines", only css-code which gets rendered by the builtin Gtk3 engine.
Comment 28 Satyajit Sahoo 2014-02-13 16:31:32 UTC
(In reply to comment #26)
> > (In reply to comment #24)
> > > I also don't see the problem with the default theme.
> > 
> > No, not the default theme. Simon is referring to the built in engine i.e. not
> > adwaita engine.
> 
> that's what "default theme" means.

Well, he said "default engine", not "default theme".

> > Greybird, Numix etc use the built in GTK3 engine and the button borders are
> > drawn by CSS unlike Adwaita, where they are drawn by SVG assets.
> 
> given that two different themes do not expose this issue, are you sure this
> isn't a bug in the Numix and Greybird theme engines, instead?

Numix, Greybird etc use the in-built engine in GTK. So if this is a bug with their theme engine, it's a bug in GTK.

Also, I've also seen the issue in Adwaita, as you can see in https://bug710909.bugzilla-attachments.gnome.org/attachment.cgi?id=258156

As a sidenote, Adwaita and Ambiance use SVG assets for drawing the borders, while Numix, Greybird etc. draw the border with CSS. That means Adwaita has a more wide border than 1px, so this issue might be cloaked in it.

> in any case, don't change to VERIFIED INCOMPLETE.

Ok. But it's not RESOLVED FIXED either.
Comment 29 Allin Cottrell 2014-02-13 16:34:33 UTC
I'm attaching a screenshot showing an instance of this bug on
(fully updated) Fedora 20. The code uses gtk_dialog_new_with_buttons
for the Cancel and OK buttons, and (for this particular use of
the dialog) adds a Help button using gtk_container_add and
gtk_button_box_set_child_secondary on the dialog's action_area.
The Help button displays correctly but the other two are broken
as described by others.
Comment 30 Allin Cottrell 2014-02-13 16:36:16 UTC
Created attachment 269039 [details]
picture of bad buttons
Comment 31 Emmanuele Bassi (:ebassi) 2014-02-13 16:47:16 UTC
re-opening, as per last comments.
Comment 32 Florian Müllner 2014-02-13 16:52:55 UTC
(In reply to comment #28)
> Ok. But it's not RESOLVED FIXED either.

According to comment #24 it is for GTK+ master / 3.11.x - have you been able to reproduce the issue with a current development snapshot / unstable version?
Comment 33 Matthias Clasen 2014-02-13 17:42:15 UTC
curious, that screenshot shows supposedly aligned buttons, some of which are cut off and some are not
Comment 34 Allin Cottrell 2014-02-13 17:48:15 UTC
(In reply to comment #29)
> The code uses gtk_dialog_new_with_buttons
> for the Cancel and OK buttons, and (for this particular use of
> the dialog) adds a Help button using gtk_container_add and
> gtk_button_box_set_child_secondary on the dialog's action_area.

I just checked, and cutting out the call to gtk_button_box_set_child_secondary doesn't help. Simply, adding the Help button to the dialog's action area via gtk_container_add somehow pushes the other buttons out of alignment: they appear to be shifted down a pixel or two so their bottoms are cut off.

No such problem with GTK 2.
Comment 35 Allin Cottrell 2014-02-13 17:57:17 UTC
(In reply to comment #33)
> curious, that screenshot shows supposedly aligned buttons, some of which are
> cut off and some are not

Ah, the cut-off disappears if I use gtk_button_box_set_child_non_homogeneous
on the added Help button. This exposes the fact that the Cancel and OK buttons are "naturally" less tall than the Help button. The resulting appearance is not very pleasing (looks a bit odd that the buttons are of different y dimensions).
I'll attach another screenshot.
Comment 36 Allin Cottrell 2014-02-13 17:58:29 UTC
Created attachment 269051 [details]
with non-homogeneous buttons
Comment 37 Satyajit Sahoo 2014-02-21 17:36:58 UTC
I have found that the buttons are cut from sides in various dialogs. Using GTK3.11 on Fedora rawhide.
Comment 38 Satyajit Sahoo 2014-02-21 17:38:56 UTC
Created attachment 269934 [details]
Buttons cut from sides in GTK dialogs
Comment 39 Simon Steinbeiss 2014-02-21 18:47:42 UTC
I just noticed (and got other to confirm) that being able to reproduce this issue seems to be connected to font-settings.

I can reproduce it with: Droid Sans <=10, 96 DPI, font hinting: slight

I can't reproduce it with: Droid Sans 11, 96 DPI, font hinting: slight

For other fonts, size 10 also works, e.g. Open Sans 10, 96 DPI, font hinting: slight.

So seems like some calculations on the label-text are going wrong and then the bottom of the widget gets pushed out of the allocated size or something?
Comment 40 Matthias Clasen 2014-03-04 02:54:30 UTC
(In reply to comment #38)
> Created an attachment (id=269934) [details]
> Buttons cut from sides in GTK dialogs

This is rather a mismatch between the theme and the way gtkmessagedialog buttons are now placed.
Comment 41 Matthias Clasen 2014-03-04 03:08:40 UTC
To make any progress here, we need a very explicit set of reproduction instructions.

- What version of GTK+
- What theme
- What fonts
- What dialog in what application

I've tried in vain to reproduce cut-off buttons with Adwaita, Ambiance, Radiance, Raleigh, Droid Sans 9, 10, 11...
Comment 42 Allin Cottrell 2014-03-04 03:53:37 UTC
(In reply to comment #41)
> To make any progress here, we need a very explicit set of reproduction
> instructions.
> 
> - What version of GTK+
> - What theme
> - What fonts
> - What dialog in what application

Speaking for comments #34 and #35:

gtk 3.10.6
Adwaita
DejaVu Sans 10
gretl: /Variable/X-12-ARIMA analysis
Comment 43 Simon Steinbeiss 2014-03-04 09:41:43 UTC
> This is rather a mismatch between the theme and the way gtkmessagedialog
buttons are now placed.

So how are they placed and what can I do to fix the placement with the default gtk engine?
(I'm happy to change the theme-code, but I didn't know I have to from Gtk3.8 to 3.10.)


My setup:
Gtk3.10.7
Greybird (https://github.com/shimmerproject/Greybird)
Droid Sans 9/10 (96 DPI)
GtkFileChooserDialog, e.g. in Gedit or Evince

This is the gtkfilechooser-dialog in Evince with the above setup, exhibiting the problem: http://www.zimagez.com/zimage/screenshot-2014-03-04-103522.php

I meanwhile tested various ways of adding padding to those buttons like -GtkButton-default-border=2 or -inner-border=2 fix it, but then the label is vertically not centered anymore, as can be seen here in Gedit: http://www.zimagez.com/zimage/screenshot-2014-03-04-103717.php.

@mclasen: thanks for not giving up on this!
Comment 44 Allin Cottrell 2014-03-04 16:38:21 UTC
Created attachment 270920 [details]
Minimal test case

I'm attaching a minimal case which displays "cut" buttons with gtk 3.10.7 + Adwaita + DejaVu Sans, and also shows a (not fully satisfactory) workaround.
Comment 45 Satyajit Sahoo 2014-03-04 16:41:46 UTC
@matthias I have just the following code for button,

* {
    -GtkButton-child-displacement-x: 0;
    -GtkButton-child-displacement-y: 0;
    -GtkButton-default-border: 0;
    -GtkButton-image-spacing: 0;
    -GtkButton-inner-border: 1;
    -GtkButton-interior-focus: true;
}

.button {
    -GtkWidget-focus-padding: 1;
    -GtkWidget-focus-line-width: 0;

    padding: 3px;
    border-width: 1px;
    border-radius: 2px;
    border-style: solid;
    border-color: shade(@theme_bg_color, 0.8);
    background-color: shade(@theme_bg_color, 1.08);
    background-image: none;
    color: @theme_fg_color;
}

What I'm doing wrong?
Comment 46 Matthias Clasen 2014-03-05 23:45:46 UTC
(In reply to comment #44)
> Created an attachment (id=270920) [details]
> Minimal test case
> 
> I'm attaching a minimal case which displays "cut" buttons with gtk 3.10.7 +
> Adwaita + DejaVu Sans, and also shows a (not fully satisfactory) workaround.

Thanks for the test case ! It works fine here with gtk master and either Raleigh or Adwaita.

I don't have the time to build 3.10 right now, unfortunately.
Comment 47 Simon Steinbeiss 2014-03-05 23:50:48 UTC
@mclasen: Even if the buttons aren't cut here with Adwaita, the labels on the buttons are clearly not vertically centered (which seems to be part of the problem): http://www.zimagez.com/zimage/screenshot-2014-03-06-005000.php
Comment 48 Simon Steinbeiss 2014-03-13 16:06:40 UTC
Ok, a bit more information that I've gathered over the last week:

1) labels are now baseline-aligned, so this might be related to the cutting off.
2) I found a workaround for the problem in the theme, see here: https://github.com/shimmerproject/Greybird/commit/e235cb445f29a2443fdfb90014e9b28af3c73caa

After being informed about 1), I understand why even Adwaita looks "off" for me, because in Gnome3 you don't have ButtonImages=1, so the different look between Gtk2 and Gtk3 isn't visible. Maybe that change should also be made in Gtk2 to ad least preserve a bit of consistency for those who still use a desktop with a mix of both 2 and 3 (just as an example, Xfce is still completely on Gtk2, but Xubuntu obviously ships many Gtk3 apps).

So with the patch from 2) my buttons don't get cut off anymore and when disabling ButtonImages, I get the look I expect.
Comment 49 Matthias Clasen 2014-12-22 02:54:23 UTC
Is anybody still having problems with this ?
Comment 50 Simon Steinbeiss 2014-12-22 10:39:19 UTC
Well it's pretty simple: since I applied the workaround I'm fine. Without it, the bug is still there.

Whether or not this is the desired behavior is up to you I guess. As mentioned above, it'd be nice in terms of consistency to see Gtk2 being patched for simple – but visually noticeable – changes like this one.
Comment 51 draymond 2015-03-18 02:10:43 UTC
I'm seeing this problem with 3.14.9 on MacOS 10.10.  I filed the following bug report: Bug 745930.
Comment 52 Matias De lellis 2015-05-10 22:39:38 UTC
Hi,
Playing with the inspector found a small detail, that perhaps is relevant. Maybe not, but prefer share it.. ;)

The primary button has the property valign=GTK_ALIGN_BASELINE
The second button has the property valign=GTK_ALIGN_FILL

Setting the primary button with GTK_ALIGN_FILL, stop cutting it.

I do not know the reasons to use GTK_ALIGN_BASELINE, but would make sense that both buttons use the same VALIGN.

Regards
Comment 53 Matthias Clasen 2016-04-05 23:12:29 UTC
Various baseline handling issues have been fixed in 3.20. I hope this is fixed. If you still see it with 3.20, please reopen