I am developing an application for Linux (RHEL, Gnome, Compiz) in Qt 4.8 using a QGraphicsScene with QGraphicsViews for each monitor. Each QGraphicsView has the Qt::X11Bypasswindowmanagerhint window hint. In order to restore keyboard focus, I have an event handler that calls activateWindow() on exactly one of the QGraphicsViews for every event (which I realize is likely overkill and incredibly inefficient). The application is one where the user may request to hide and show it often; when I call show() on that same particular QGraphicsView that is being activated in the event handler, an X11 error event occurs. In particular, the error has an error code of 8, which corresponds to a BadMatch error, and major operation code of 42, which I believe corresponds to XSetInputFocus().
First, is this an error that can be simply ignored via a custom x11 event handler (because the application in fact works)? Second, is there a better way to call activateWindow when using this particular window hint with a QGraphicsView? And if not, is there at least a way to avoid this error?