From 451ba581558e61762b0bdee98df68838927a45f0 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Sat, 25 Oct 2014 02:31:52 +0200 Subject: [PATCH] Fixed window resize by to long text in inputbox. The GTK3 text view grows with it's content and forces the whole main window to increase. To fix this, the text view is put into a scrolled window. This might be a hack, because we do not use the scrolled window itself, but this restores the behaviour of the plain text view of GTK2. --- src/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.c b/src/main.c index d0ab663..1a0fb0d 100644 --- a/src/main.c +++ b/src/main.c @@ -819,7 +819,17 @@ static void init_core(void) gtk_box_pack_start(gui->box, scroll, true, true, 0); gtk_box_pack_start(gui->box, gui->eventbox, false, false, 0); + +#ifdef HAS_GTK3 + /* use a scrolled window to hide overflowing text in inputbox like GTK2 */ + GtkWidget *inputscroll = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(inputscroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); + gtk_container_add(GTK_CONTAINER(inputscroll), gui->input); + + gtk_box_pack_end(gui->box, inputscroll, false, false, 0); +#else gtk_box_pack_end(gui->box, gui->input, false, false, 0); +#endif /* init some state variable */ vb.state.enable_register = false; -- 2.20.1