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 747584 - Using gtk_window_set_geometry_hints() to set a fixed aspect ratio makes GtkWindow shrink to 1x1
Using gtk_window_set_geometry_hints() to set a fixed aspect ratio makes GtkWi...
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: .General
3.22.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-04-09 19:52 UTC by zebediah49+jk
Modified: 2018-05-02 16:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A minimal working example of the bug (1.95 KB, text/plain)
2015-04-09 19:52 UTC, zebediah49+jk
Details
edited test case by Rafał Mużyło (1.51 KB, text/plain)
2018-04-08 19:18 UTC, Daniel Boles
Details

Description zebediah49+jk 2015-04-09 19:52:02 UTC
Created attachment 301236 [details]
A minimal working example of the bug

I have a piece of software that uses gtk_window_set_geometry_hints to set a fixed (1:1) aspect ratio for a window.  This worked until I updated from 3.12 to 3.14.  It now produces a 0-size window that cannot be resized properly.  Rather than showing a window normally, it resizes to become very small.  Attempts to resize it have resulted in the window refusing to change size, becoming very large, and in one case locking up the window manager.

I tracked the issue down to a minimal working example (the attached code), in which an aspect range of 0.5-2.0 works fine, but a range of 1.0-1.0 does not. 

Using geometry hints to impose a minimum and maximum size works, but the window cannot be set to anything other than the two extremes.

Interestingly, on the working version, horizontally-constrained resizing (tall window) works smoothly, while vertically-constrained resizing (wide window) resizes in an unstable and shaky manner.

I've attached a piece of example code demonstrating the bug.  Compile normally to get the working version, with -D FIXED_ASPECT to get the broken 1:1 version.

-----

Reproduction instructions:

Compile attached code with
gcc -D FIXED_ASPECT -o gtkTest gtkTest.c `pkg-config --cflags gtk+-3.0` `pkg-config --libs gtk+-3.0`
Run executable

Expected results:
A 200x200 window that can be resized with 1:1 aspect ratio

Actual results:
A tiny window that cannot be resized

Bonus: compile with
gcc -o gtkTest gtkTest.c `pkg-config --cflags gtk+-3.0` `pkg-config --libs gtk+-3.0`
to get a version that mostly resizes correctly.

-----

System: Gentoo, kernel 3.10.25,
gcc (Gentoo 4.8.3 p1.1, pie-0.5.9) 4.8.3
gtk+3.14.9
built with USE="X cups introspection xinerama (-aqua) -broadway -cloudprint -colord -debug -examples {-test} -vim-syntax -wayland
Comment 1 Matthias Clasen 2018-02-10 05:04:16 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 2 Daniel Boles 2018-04-08 07:50:21 UTC
https://gitlab.gnome.org/GNOME/gtk/issues/164 may be a dupe
Comment 3 Emmanuele Bassi (:ebassi) 2018-04-08 14:58:44 UTC
Resolving NEEDINFO.
Comment 4 Daniel Boles 2018-04-08 19:18:06 UTC
Created attachment 370666 [details]
edited test case by Rafał Mużyło

who wrote at the aforementioned GitLab Issue:



"Attached is a trimmed down copy of the testcase from that bug.

Trimming down is mostly due to the problem being identified wrong in that bug.

See the commented line:


for window size 160x32, aspect of 3.0 makes the window shrink into 1x1
for the same size, aspect of 3.01 makes the window size itself correctly


Chances are it's window manager dependent, so openbox 3.6.1.

gtk+-3.22.19"
Comment 5 GNOME Infrastructure Team 2018-05-02 16:31:46 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/546.