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 698030 - GtkButton size_allocate and get_size (get_preferred_width/height) mismatch
GtkButton size_allocate and get_size (get_preferred_width/height) mismatch
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkButton
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-04-15 00:53 UTC by Andrzej
Modified: 2014-09-29 19:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A fix (854 bytes, patch)
2013-04-15 22:48 UTC, Andrzej
none Details | Review

Description Andrzej 2013-04-15 00:53:57 UTC
gtk_button_get_size does _not_ check can_focus flag before adding focus-line-width and focus-padding.
gtk_button_size_allocate does check can_focus flag, before subtracting line-width and focus-padding.

This means that if the can_focus flag is set to FALSE, child allocation is larger than the size requested by it.

In certain conditions, when e.g. the child uses its previous allocation to request a new size, this makes the child grow at every size request/allocate cycle.
Comment 1 Andrzej 2013-04-15 22:48:30 UTC
Created attachment 241602 [details] [review]
A fix

A patch against gtk-3-6 illustrating the idea.
Comment 2 Matthias Clasen 2014-09-29 19:50:54 UTC
we no longer use focus_width or focus_pad in gtkbutton.c