aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2012-11-21 18:45:07 +0000
committerSimon Tatham <anakin@pobox.com>2012-11-21 18:45:07 +0000
commite17bf4abec88eba9511639e2495d6c1c35ad2311 (patch)
tree7bb333368d67874b4d69da85b6748f152d7520bc
parent2a2520b8e7985242d0e970d8db0eff06d8657d34 (diff)
downloadpuzzles-e17bf4abec88eba9511639e2495d6c1c35ad2311.zip
puzzles-e17bf4abec88eba9511639e2495d6c1c35ad2311.tar.gz
puzzles-e17bf4abec88eba9511639e2495d6c1c35ad2311.tar.bz2
puzzles-e17bf4abec88eba9511639e2495d6c1c35ad2311.tar.xz
Fix overnight build failure last night, by making the new call to
gtk_widget_get_allocation conditional on GTK being new enough to have that function. I'm assuming until someone proves otherwise that if it isn't that new, then it also isn't one of the versions of GTK which exhibit the bug which that call was working around (since gtk_widget_get_allocation came in 2.18, and the problem seems to have arisen since 2.20). [originally from svn r9712]
-rw-r--r--gtk.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gtk.c b/gtk.c
index 8452bcd..714d679 100644
--- a/gtk.c
+++ b/gtk.c
@@ -1672,13 +1672,19 @@ static gboolean not_size_allocated_yet(GtkWidget *w)
* size allocation. A null widget is already taking up all the
* space it ever will.)
*/
- GtkAllocation a;
-
if (!w)
return FALSE; /* nonexistent widgets aren't a problem */
- gtk_widget_get_allocation(w, &a);
- return a.height == 0 || a.width == 0;
+#if GTK_CHECK_VERSION(2,18,0) /* skip if no gtk_widget_get_allocation */
+ {
+ GtkAllocation a;
+ gtk_widget_get_allocation(w, &a);
+ if (a.height == 0 || a.width == 0)
+ return TRUE; /* widget exists but has no size yet */
+ }
+#endif
+
+ return FALSE;
}
static void try_shrink_drawing_area(frontend *fe)