From 3e86aa1bc6566e703deac48d322791c23b3e49b2 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Mon, 24 Aug 2015 19:04:37 +0100 Subject: [PATCH] Another GTK3 fix for GtkEntry width. When I committed 5e738877b the other day, I missed another case of the same thing in the file/font selector handling. --- unix/gtkdlg.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/unix/gtkdlg.c b/unix/gtkdlg.c index aaa62c6d..e77b1159 100644 --- a/unix/gtkdlg.c +++ b/unix/gtkdlg.c @@ -2146,7 +2146,6 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs, case CTRL_FONTSELECT: { GtkWidget *ww; - GtkRequisition req; const char *browsebtn = (ctrl->generic.type == CTRL_FILESELECT ? "Browse..." : "Change..."); @@ -2169,8 +2168,15 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs, } uc->entry = ww = gtk_entry_new(); - gtk_widget_size_request(ww, &req); - gtk_widget_set_size_request(ww, 10, req.height); +#if !GTK_CHECK_VERSION(3,0,0) + { + GtkRequisition req; + gtk_widget_size_request(ww, &req); + gtk_widget_set_size_request(ww, 10, req.height); + } +#else + gtk_entry_set_width_chars(GTK_ENTRY(ww), 1); +#endif columns_add(COLUMNS(w), ww, 0, 1); gtk_widget_show(ww);