chiark / gitweb /
GTK 3 port: condition out the complicated window resize code.
authorSimon Tatham <anakin@pobox.com>
Sat, 3 Oct 2015 11:28:13 +0000 (12:28 +0100)
committerSimon Tatham <anakin@pobox.com>
Sat, 3 Oct 2015 15:07:18 +0000 (16:07 +0100)
commit4e1cc6570180381866735d7e23223f4ac4a68b08
treee00318b5951877883d520ee715eb31a466eab9d2
parent37232c3c304d07fcfb8d8f512c0359a7f23fea82
GTK 3 port: condition out the complicated window resize code.

In GTK 2, we had a big pile of horrible code to deal with the fact
that it's very hard to open a window in such a way as to make it easy
to resize smaller as well as bigger.

Essentially, we'd open the window with the drawing area's minimum size
request set to the desired _initial_ window size; then we'd wait until
GTK had finished creating other window components (menu bar, status
line) and the window's size allocation had settled down, and finally
reduce the size request to the real minimum size so that now the
window was resizable in both directions. This also involved some
deliberate checking of the Ubuntu Unity GTK extension which steals the
menu bar and put it elsewhere (see commit 8f8333a35), to avoid us
waiting forever for a menu bar that wasn't going to show up.

But in GTK3, this has all become actually sensible! All we now have to
do is to set the window's geometry hints to indicate the drawing area
itself as the base widget (probably a good plan anyway), and then we
can set the initial size using gtk_window_set_default_geometry() and
resize it later using gtk_window_resize_to_geometry(). So now we can
completely condition out all of the previous horrors, and consider
them to be legacy GTK2 compatibility code only. Phew.
gtk.c