Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.0
-
None
-
Windows 10, Intel Graphics
Description
I used a example from github which generates a true frameless window in windows.
The problem occurs only if we add a QQuickWidget as content and move the window to another screen. After reaching the other screen we got a black frame around the widget/window. Seems to be a OpenGL error discussed here: Bug There is also a cursor offset when this border is displayed.
Also maybe related: QTBUG-40485
Solution:
I'm able to fix this by overwrite the moveEvent (as found here):
class CFramelessWindow: public QMainWindow { // rest of the class private: QScreen* current_screen = nullptr; void moveEvent(QMoveEvent* event) { if (current_screen == nullptr) { current_screen = screen(); } else if (current_screen != screen()) { current_screen = screen(); SetWindowPos((HWND) winId(), NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_FRAMECHANGED | SWP_NOACTIVATE); } } };
The example (code from git with fix) is attached.