3
« on: March 09, 2012, 02:51:01 pm »
So I have been trying to research a bug for a while now. This is on SFML2, pretty recently pulled from Github.
While using an SFML canvas with Qt (on Linux/X11) and resizing the canvas to be larger, it appears that WindowImplX11 does not actually receive any XEvents (or at least not ConfigureNotify) during its event processing. From what I can tell this is because Qt is handling the events before SFML polls for them. This manifests itself mostly in the fact that the internal window size is never updated which means that calls to SetSize() are totally useless. As such, we cannot update the back buffer and the increase in window size just leads to a black (or whatever your Clear() color is) area on the screen.
I have been researching solutions to this but I haven't been able to come up with a good one. The way the Window/RenderWindow interface is structured makes it pretty difficult to access the window implementation (not to mention that WindowImplX11 is not accessible through header includes unless you add the SFML source files to your search path), and even with access to WindowImplX11 SFML2 currently does not expose ProcessEvent() to the public.
I could probably hack together a solution that would solve my issues, but it seems like this should be something that should be fixed in SFML2. Well, not really fixed, since it's Qt that is stealing events from SFML, but at least expose a way to handle this. I can receive XEvents to the QSFMLCanvas class (as per the Qt+SFML tutorial) with QWidget::x11Event(XEvent*), but there is no good way for them to reach WindowImplX11 at the moment. Any ideas?