Subject: Re: bug#48413: 28.0.50; emacs does not repaint the window after switching workspaces in Xmonad

From: Platon Pronko <[email-masked]>
Date: Fri, 14 May 2021 18:28:29 +0300

> Can you please try the attached patch and tell me whether it improves or
> breaks things.

Yes, it fixes things - frame is repainted correctly now.

My attempt was similar, but I included more code alongside SET_FRAME_VISIBLE (same as in Expose handler):

+              block_input ();
+             SET_FRAME_VISIBLE (f, 1);
+             if (FRAME_X_DOUBLE_BUFFERED_P (f))
+                font_drop_xrender_surfaces (f);
+              f->output_data.x->has_been_visible = true;
+              SET_FRAME_GARBAGED (f);
+              unblock_input ();

I'm not very familiar with Emacs frame internals - we don't need all these here?

> Relying on these for setting visibility will fail for anyone who doesn't
> send us an Expose event. 

I agree, feels a little fragile.

Best regards,
Platon Pronko