From adf8fc1ab092cf0d1c4ff4f037b6fe9eb1a409d1 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 18 Dec 2021 14:49:11 +0000 Subject: [PATCH] GTK: fix return type of window-state-event handler. The event should return a 'gboolean', indicating whether the event needs propagating any further. We were returning void, which meant that the default handling might be accidentally suppressed. On Wayland, this had the particularly nasty effect that window redraws would stop completely if you maximised the terminal window. (By trial and error I found that this stopped happening if I removed GDK_HINT_RESIZE_INC from the geometry hints, from which I guess that the default window-state-event handler is doing something important relating to that hint, or would have been if we hadn't accidentally suppressed it. But the bug is clearly here.) --- unix/window.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unix/window.c b/unix/window.c index c9d635ab..da16703e 100644 --- a/unix/window.c +++ b/unix/window.c @@ -651,12 +651,13 @@ gint delete_window(GtkWidget *widget, GdkEvent *event, GtkFrontend *inst) } #if GTK_CHECK_VERSION(2,0,0) -static void window_state_event(GtkWidget *widget, GdkEventWindowState *event, - gpointer user_data) +static gboolean window_state_event( + GtkWidget *widget, GdkEventWindowState *event, gpointer user_data) { GtkFrontend *inst = (GtkFrontend *)user_data; term_notify_minimised( inst->term, event->new_window_state & GDK_WINDOW_STATE_ICONIFIED); + return false; } #endif