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

From: Po Lu <[email-masked]>
Date: Sat, 03 Sep 2022 13:01:11 +0800

夜坂雅 <[email-masked]> writes:

> I can setup a condition of f->iconified.
>
> So:
>
> 1. Setup GDB to break at the location you said, which (I believe) is src/pgtkterm.c:5507
> https://git.savannah.gnu.org/cgit/emacs.git/tree/src/pgtkterm.c#n5507
> 2. Setup a condition of f->iconified on the breakpoint.
> 3. Start Emacs PGTK and iconify it. It'll hit breakpoint. run `continue'
> in GDB.
> 4. Deiconify it. This breakpoint won't be hit.
>
> Feel free to ask me to provide more infomation.

Does the bug still happen with this patch applied?  It does mean that
iconification will no longer be reported correctly, but GDK simply
doesn't report iconification state to programs on Wayland.

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index b283cef7cd..68365c0887 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -734,7 +734,7 @@ pgtk_iconify_frame (struct frame *f)
 
       gtk_window_iconify (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)));
       SET_FRAME_VISIBLE (f, 0);
-      SET_FRAME_ICONIFIED (f, true);
+      /* SET_FRAME_ICONIFIED (f, true); */
       unblock_input ();
       return;
     }