Domanda

In a call to XPending() I get following error message in terminal:

XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"

This happens after I click the close button on the window (the cross in the corner).

Otherwise the program works fine. I suggest when I click the close button, the window manager will abruptly disconnect my app from the XServer. So the connection is no longer active and XPending returns an error. Can I somehow check if connection is still active or not prior to calling XPending()? What is a recommended "good practice" here?

È stato utile?

Soluzione

You need to handle WM_DELETE_WINDOW message that icccm-compliant window manager sends to client before closing it's window. After last top level window is closed connection to X server is usually closed by server.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top