<div dir="ltr"><div dir="ltr">On Wed, 27 May 2020 at 16:08, Olaf Hering <<a href="mailto:olaf@aepfle.de">olaf@aepfle.de</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
> But if the client triggers the non-responsive dialog that's because it<br>
> claims to support _NET_WM_PING but does not reply to the _NET_WM_PING<br>
> message in timely manner, which would be a bug in the client.<br>
<br>
How does a client claim support for it?<br></blockquote><div><br></div><div>Just by listing NET_WM_PINGin the list of supported protocols.</div><div><br></div><div><a href="https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html#idm45513934498688">https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html#idm45513934498688</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
There are no traces of that string in the sources, xprop does say it is enabled.<br>
WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST<br>
<br>
Is there a gtk function to enable or disable it?<br>
Google did not reveal useful results for "_NET_WM_PING" AND "gtk".</blockquote><div><br></div><div> A GTK based client does not need to claim anything, GTK itself supports it.</div><div><br></div><div><a href="https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gdk/x11/gdkwindow-x11.c#L793">https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gdk/x11/gdkwindow-x11.c#L793</a><br></div><div><br></div><div>The toolkit itself (i.e. GTK) takes care of replying th ping request automatically:</div><div><br></div><div><a href="https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gdk/x11/gdkdisplay-x11.c#L1482">https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gdk/x11/gdkdisplay-x11.c#L1482</a><br></div><div><br></div><div>But the GTK main event loop needs to be running for this to work of course, the client needs to make sure the mainloop is called even when it's busy with other stuff:</div><div><br></div><div><a href="https://developer.gnome.org/gtk3/stable/gtk3-General.html#gtk-events-pending">https://developer.gnome.org/gtk3/stable/gtk3-General.html#gtk-events-pending</a><br></div><div><br></div><div>So if one just spawns some process or computation and just wait for completion without calling the GTK event loop in the mean time, the ping won't be replied and the WM will assume the client is hung (which is true, in fact, as it does not reply).</div><div><br></div><div>Cheers</div><div>Olivier</div></div></div>