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 740640 - Zero-sized widgets
Zero-sized widgets
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
: 741210 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-11-24 17:06 UTC by Emmanuele Bassi (:ebassi)
Modified: 2018-02-06 11:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Emmanuele Bassi (:ebassi) 2014-11-24 17:06:45 UTC
currently, GtkWidget imposes a minimum size of 1x1 to the allocation. this minimum size was needed because X windows cannot have a size of 0; thus, GdkWindow cannot have a size of 0; thus all GTK widgets must have a minimum size of 1x1.

we don't create GdkWindow for each widget, and the ones we do create are for input purposes only. yet, the 1x1 limit remained inside GtkWidget, and makes it hard to do transitions of widgets without leaving 1 pixel trails here and there.

we could drop this requirement if the widget does not have any GdkWindow registered through gtk_widget_register_window(), but that would probably leave pre-3.8 code in the blind.

we could also check if the widget has a window (i.e. gtk_widget_get_has_window() returns TRUE).

there's also the possibility of lifting the 1x1 size limit in GdkWindow itself, and only enforce it for the X11 backend.
Comment 1 Emmanuele Bassi (:ebassi) 2014-11-24 17:40:15 UTC
other backends outside of X11 will likely die if they get passed a 0x0 size to GdkWindow.move_resize() — so if we want to allow GdkWindow to have a size of 0x0 without dying we are going to end up with some nasty ad hoc checks.

docs/sizing-test.txt says:

> - passing 0 is allowed, and results in requisition of 1x1 
>   (0x0 is a permitted requisition, but equivalent to 1x1, 
>   we use 1x1 for implementation convenience)

which makes the requisition, not the allocation, have a minimum size of 1x1; in theory this gives us a bit of leeway to allow a 0x0 allocation, if we ensure that the behaviour of widgets with GdkWindows does not change — i.e. if we ensure that widgets calling gdk_window_move_resize() with allocation.width and allocation.height are not going to emit criticals and die.
Comment 2 Matthias Clasen 2014-12-07 22:03:24 UTC
*** Bug 741210 has been marked as a duplicate of this bug. ***
Comment 3 Timm Bäder 2018-02-06 11:51:43 UTC
I guess we fixed this as much as we could in master, but it won't change for gtk3.