Subject: bug#55836: 29.0.50; (iconify-frame) freezes buffer view under Wayland.

From: Po Lu <[email-masked]>
Date: Sun, 25 Sep 2022 20:06:24 +0800

Tino Calancha <[email-masked]> writes:

> We can reproduce the issue in our machine [1].
> The following patch works for us:
>
> commit 3f4aec4692b2e87bf69856b6d5870be46fd61f1e
>      Fix Bug#55836
>
>      * src/pgtkterm.c (window_state_event):
>      Always set the frame visible when deiconifying it (Bug#55836).
>
> diff --git a/src/pgtkterm.c b/src/pgtkterm.c
> index 491ba33882..4a62ca0e41 100644
> --- a/src/pgtkterm.c
> +++ b/src/pgtkterm.c
> @@ -5508,6 +5508,7 @@ window_state_event (GtkWidget *widget,
>         inev.ie.kind = DEICONIFY_EVENT;
>         XSETFRAME (inev.ie.frame_or_window, f);
>         SET_FRAME_ICONIFIED (f, false);
>
> +      SET_FRAME_VISIBLE (f, 1); /* Bug#55836 */
>       }
>
>     if (new_state & GDK_WINDOW_STATE_STICKY)

Is that on Wayland or X?

Note that the PGTK build does not support X anyway, but please try this:

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 491ba33882..cb4351616e 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -6424,10 +6424,12 @@ pgtk_set_event_handler (struct frame *f)
 			G_CALLBACK (pgtk_handle_event), NULL);
       g_signal_connect (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), "configure-event",
 			G_CALLBACK (configure_event), NULL);
+
+      /* The map event always comes from the toplevel window.  */
+      g_signal_connect (G_OBJECT (FRAME_GTK_OUTER_WIDGET (f)), "map-event",
+			G_CALLBACK (map_event), NULL);
     }
 
-  g_signal_connect (G_OBJECT (FRAME_GTK_WIDGET (f)), "map-event",
-		    G_CALLBACK (map_event), NULL);
   g_signal_connect (G_OBJECT (FRAME_GTK_WIDGET (f)), "size-allocate",
 		    G_CALLBACK (size_allocate), f);
   g_signal_connect (G_OBJECT (FRAME_GTK_WIDGET (f)), "key-press-event",