aboutsummaryrefslogtreecommitdiff
path: root/gtk.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2018-11-25 00:46:48 +0000
committerSimon Tatham <anakin@pobox.com>2018-11-25 00:46:48 +0000
commit0a5d13bcd5e6a88418abaf528d9d529ced7dfb9c (patch)
tree017990678ea42d7c3f3180542f7b73173f3b19b3 /gtk.c
parentd9e03f50daffc37027a5c57c88c7fd4241a58782 (diff)
downloadpuzzles-0a5d13bcd5e6a88418abaf528d9d529ced7dfb9c.zip
puzzles-0a5d13bcd5e6a88418abaf528d9d529ced7dfb9c.tar.gz
puzzles-0a5d13bcd5e6a88418abaf528d9d529ced7dfb9c.tar.bz2
puzzles-0a5d13bcd5e6a88418abaf528d9d529ced7dfb9c.tar.xz
Fix GTK 2 crash introduced by previous commit.
Moving the snaffle_colours() call earlier is fine in GTK 3, where the potential call to frontend_default_colour doesn't depend on the window already having been created. But it falls over in GTK 2 where it does. Moved the non-headless-mode version of that call back to where it was before the --screenshot change.
Diffstat (limited to 'gtk.c')
-rw-r--r--gtk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk.c b/gtk.c
index c0bcb95..d41f867 100644
--- a/gtk.c
+++ b/gtk.c
@@ -2575,9 +2575,8 @@ static frontend *new_window(
midend_new_game(fe->me);
}
- snaffle_colours(fe);
-
if (headless) {
+ snaffle_colours(fe);
get_size(fe, &fe->pw, &fe->ph);
setup_backing_store(fe);
return fe;
@@ -2790,6 +2789,8 @@ static frontend *new_window(
changed_preset(fe);
+ snaffle_colours(fe);
+
if (midend_wants_statusbar(fe->me)) {
GtkWidget *viewport;
GtkRequisition req;