aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Nevins <jacobn@chiark.greenend.org.uk>2005-06-26 12:54:08 +0000
committerJacob Nevins <jacobn@chiark.greenend.org.uk>2005-06-26 12:54:08 +0000
commite1c84c9a4ea9e74c128c28a77ea08336350991e3 (patch)
treeae0ab9e38ef60f9a2a59f05f3cf941745297b242
parent258293a82a76f716dbbcd6517f3b835162e9b257 (diff)
downloadpuzzles-e1c84c9a4ea9e74c128c28a77ea08336350991e3.zip
puzzles-e1c84c9a4ea9e74c128c28a77ea08336350991e3.tar.gz
puzzles-e1c84c9a4ea9e74c128c28a77ea08336350991e3.tar.bz2
puzzles-e1c84c9a4ea9e74c128c28a77ea08336350991e3.tar.xz
Under Gtk 1.2 (at least on Debian woody), a config or preset change that would
otherwise not cause the window size to change caused it to become very small indeed. This change from Simon fixes that behaviour; I haven't tested it with Gtk 2. [originally from svn r6022]
-rw-r--r--gtk.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gtk.c b/gtk.c
index 4b789cb..9b95d48 100644
--- a/gtk.c
+++ b/gtk.c
@@ -998,7 +998,11 @@ static void menu_preset_event(GtkMenuItem *menuitem, gpointer data)
fe->w = x;
fe->h = y;
gtk_drawing_area_size(GTK_DRAWING_AREA(fe->area), x, y);
- gtk_window_resize(GTK_WINDOW(fe->window), 1, 1);
+ {
+ GtkRequisition req;
+ gtk_widget_size_request(GTK_WIDGET(fe->window), &req);
+ gtk_window_resize(GTK_WIDGET(fe->window), req.width, req.height);
+ }
}
GdkAtom compound_text_atom, utf8_string_atom;
@@ -1143,7 +1147,11 @@ static void menu_config_event(GtkMenuItem *menuitem, gpointer data)
fe->w = x;
fe->h = y;
gtk_drawing_area_size(GTK_DRAWING_AREA(fe->area), x, y);
- gtk_window_resize(GTK_WINDOW(fe->window), 1, 1);
+ {
+ GtkRequisition req;
+ gtk_widget_size_request(GTK_WIDGET(fe->window), &req);
+ gtk_window_resize(GTK_WIDGET(fe->window), req.width, req.height);
+ }
}
static void menu_about_event(GtkMenuItem *menuitem, gpointer data)