Window contents flicker when resizing
-
I've made a custom border for my Qt Quick application which moves and resizes the window based on the mouse position.
The problem I have with it is that the contents of the window jump around a few frames late as I resize it.Using WA_TranslucentBackground, X11BypassWindowManagerHint or BypassWindowManagerHint as a flag fixes this problem, but causes more problems by making the window sometimes disappear completely (especially when moving it to the right side of the screen for some reason):
I tried some other flags that were suggested which didn't help.
I'm changing the window size by making a QObject pointer
QObject *mainWindow = engine.rootObjects().first();
and setting the positions, width, and height individually withwindow->setProperty("width", width);
. I'm not sure if that's part of the problem. -
Found the proper way to resize the window. I had to use
QWindow *mainWindow = app.topLevelWindows().first();
to get the window and then I just used the QWindow functions to do the job.
It works way faster now with a bit less graphical issues.
Looks like this now. I changed it so there's only one resize call for every position change event. It resizes smoothly but the contents of the window still jump around a bit. I also addedqApp->processEvents();
which seems to help a little bit.