Willy K.
Willy K.

Reputation: 432

Issue with "blanking screen" when running Qt application in fullscreen mode

We have a Qt based browser application which uses QWebEninge under the hood. Currently we are fighting with an issue where the screen goes blank for a moment eacht time the window gets or looses the focus (f.ex. each time the QVirtualKeyboard becomes invoked). Following a Qt's recommendation, we tried to implement QWindowsWindowFunctions::setHasBorderInFullScreen prior to call of QMainWindow::showFullScreen(). But this results in an inacceptable reduction of the available window area, e.g. 1918x1078 instead of 1920x1080 (this fix adds WS_BORDER to the window flags).

During some experiments if found out that the problem also - and only - occours, if I use QMainWindow::show() while setting the window's size in a way that it exactly matches the screen's resolution. With other words: Going beyond the screen's bounds isn't a problem. Therefore, my idea was to get such a WS_BORDER around my QMainWinow and size/place it in a way so that the availabe area covers the screen.

My questions are:

Thanks in advance.

Upvotes: 0

Views: 1667

Answers (1)

Willy K.
Willy K.

Reputation: 432

As a workaround I tried to placed a hidden (opaque) mini window (0x0px) using Qt::WindowStaysOnTopHint - that worked. If anyone knows a better solution please let us know. Thanks.

EDIT It was a accidental finding: The magnifier tool from Windows was active for some reason and i noticed that the problem does not occurr when the magnifier is in front of my applications Windows. As a conclusion of that, I tried to place an "always on top" window and could see that it worked. In the end I wanted to hide this "overlay", which was done by setting it's width/height to 0px/0px. However, it seems there are some generic issues regarding Qt and the Intel HD Graphics adapter of the system in scope. As far as I remember, the issue only occurs whe the (fullscreen) window's size mathces the geometry of the display - resizing it by at least on pixel beyond the display's geometry helped, but this was no option in our case.

Upvotes: 1

Related Questions