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

From: martin rudalics <[email-masked]>
Date: Fri, 14 May 2021 11:50:38 +0200

Thanks for the forensics.  They clarify things with Bug#48268.

 > Specifically the commenting of SET_FRAME_VISIBLE(f, 1) causes the problem (if I uncomment that line, buffer redisplay starts to work correctly).
 >
 > Trying the same with XFCE doesn't give the error. I compared the sequences of X events received under different WMs, here's the lists (without "other", "MotionNotify" and key events, for brevity):
 >
 > Xmonad:
 > 1. When switching to different workspace:
 >     - FocusOut x3
 >     - UnmapNotify x1
 >     - LeaveNotify x2
 >     - PropertyNotify x2
 > 2. When switching back:
 >     - MapNotify x1

Can you tell me why we do not SET_FRAME_VISIBLE when receiving the
MapNotify event here?  Probably because we are not yet visible - though
mapped but invisible is a queer state.

 >     - VisibilityNotify x3

Maybe we should process VisibilityNotify events.

 >     - Expose x4

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

 >     - EnterNotify x2
 >     - FocusIn x2
 >     - ClientMessage x1
 >     - PropertyNotify x1
 >     - FocusIn x1
 >
 > XFCE:
 > 1. When switching to different workspace:
 >     - FocusOut x2
 >     - FocusIn x1
 >     - FocusOut x2
 >     - LeaveNotify x2
 >     - UnmapNotify x1
 >     - PropertyNotify x3
 > 2. When switching back:
 >     - VisibilityNotify x3
 >     - Expose x4
 >     - EnterNotify x2
 >     - PropertyNotify x2
 >     - FocusIn x2
 >     - ClientMessage x1
 >     - PropertyNotify x2
 >     - FocusOut x2
 >     - FocusIn x1
 >     - FocusOut x2
 >     - FocusIn x2

So here we don't get a MapNotify anyway when switching back and using
VisibilityNotify should be TRT.

martin