From 7780ee9e5f20f80ab9e053058d0b6d92586cf876 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 16 Jan 2017 13:26:09 +0100 Subject: Windows QPA: Call InvalidateRect() in WM_PAINT/GL Software rendering Bring back the call to InvalidateRect() removed by change 6086c81e4d999d88ce4d412 since it seems that GL Software rendering requires it (also for single buffer mode). Task-number: QTBUG-58178 Change-Id: I197a1b3c3906c4afa43943db30dbc07dfb656cc7 Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index a9b061ad73..6894062d61 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -43,7 +43,7 @@ #include "qwindowsscreen.h" #include "qwindowsintegration.h" #include "qwindowsnativeinterface.h" -#include "qwindowsopenglcontext.h" +#include "qwindowsglcontext.h" #ifdef QT_NO_CURSOR # include "qwindowscursor.h" #endif @@ -1582,6 +1582,16 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message, return false; PAINTSTRUCT ps; +#if QT_CONFIG(dynamicgl) + // QTBUG-58178: GL software rendering needs InvalidateRect() to suppress + // artifacts while resizing. + if (testFlag(OpenGLSurface) + && QOpenGLStaticContext::opengl32.moduleIsNotOpengl32() + && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) { + InvalidateRect(hwnd, 0, false); + } +#endif // dynamicgl + BeginPaint(hwnd, &ps); // Observed painting problems with Aero style disabled (QTBUG-7865). -- cgit v1.2.1 From 79352528a1726b4551ea4d9285dd2394dd0d43da Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 16 Nov 2016 10:53:44 +0100 Subject: Windows QPA: Prevent usage of child windows as transient parent When using foreign window integrations such as MFC/winmigrate, it is possible that a child window is found which can cause issues with modality. Loop up to top level. Task-number: QTSOLBUG-71 Task-number: QTBUG-57159 Change-Id: Ib36e0f8f4f6b1e22ba1240013871facef2c0c1ab Reviewed-by: Andy Shaw --- src/plugins/platforms/windows/qwindowswindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 6894062d61..b5522c1f90 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1273,6 +1273,12 @@ void QWindowsWindow::updateTransientParent() const if (const QWindowsWindow *tw = QWindowsWindow::windowsWindowOf(tp)) if (!tw->testFlag(WithinDestroy)) // Prevent destruction by parent window (QTBUG-35499, QTBUG-36666) newTransientParent = tw->handle(); + + // QTSOLBUG-71: When using the MFC/winmigrate solution, it is possible that a child + // window is found, which can cause issues with modality. Loop up to top level. + while (newTransientParent && (GetWindowLongPtr(newTransientParent, GWL_STYLE) & WS_CHILD) != 0) + newTransientParent = GetParent(newTransientParent); + if (newTransientParent != oldTransientParent) SetWindowLongPtr(m_data.hwnd, GWL_HWNDPARENT, LONG_PTR(newTransientParent)); } -- cgit v1.2.1 From 0c415793b9622eef2148fdd21a2f3c2394a78d99 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 25 May 2016 11:51:17 +0200 Subject: Windows QPA: More fine-grained suppression of geometry/state change events When switching windows from fullscreen to maximized, move and resize events are triggered when changing the window decorations, ending up in QWindowsWindow::handleResized(), QWindowsWindow::handleMoved() which then may call handleGeometryChange(). Change 917ef5787444403ce0f7f035e27b1740c7672e34 blocks the emission of events depending on flag WithinSetStyle from handleGeometryChange() for Windows CE. This has issues which become visible when switching from fullscreen to maximized repeatedly: - State change events are still sent from QWindowsWindow::handleResized(), QWindowsWindow::handleMoved() when changing the window style programmatically causing the maximized state to be lost after a few cycles(QTBUG-53368). - Geometry change events are actually needed on the desktop for proper redrawing (QTBUG-53577). Make this more fine-grained by suppressing all state changed events while WithinSetStyle is set and allowing geometry changes. Amends 917ef5787444403ce0f7f035e27b1740c7672e34. Task-number: QTBUG-53368 Task-number: QTBUG-53577 Change-Id: Icc8dc935cfc29b314aab2d6fac02c97174c79c3e Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowswindow.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 5edf40b886..fb69936772 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1488,18 +1488,22 @@ void QWindowsWindow::handleResized(int wParam) case SIZE_MAXHIDE: // Some other window affected. case SIZE_MAXSHOW: return; - case SIZE_MINIMIZED: - handleWindowStateChange(Qt::WindowMinimized); + case SIZE_MINIMIZED: // QTBUG-53577, prevent state change events during programmatic state change + if (!testFlag(WithinSetStyle)) + handleWindowStateChange(Qt::WindowMinimized); return; case SIZE_MAXIMIZED: - handleWindowStateChange(Qt::WindowMaximized); + if (!testFlag(WithinSetStyle)) + handleWindowStateChange(Qt::WindowMaximized); handleGeometryChange(); break; case SIZE_RESTORED: - if (isFullScreen_sys()) - handleWindowStateChange(Qt::WindowFullScreen); - else if (m_windowState != Qt::WindowNoState && !testFlag(MaximizeToFullScreen)) - handleWindowStateChange(Qt::WindowNoState); + if (!testFlag(WithinSetStyle)) { + if (isFullScreen_sys()) + handleWindowStateChange(Qt::WindowFullScreen); + else if (m_windowState != Qt::WindowNoState && !testFlag(MaximizeToFullScreen)) + handleWindowStateChange(Qt::WindowNoState); + } handleGeometryChange(); break; } @@ -1507,9 +1511,6 @@ void QWindowsWindow::handleResized(int wParam) void QWindowsWindow::handleGeometryChange() { - //Prevent recursive resizes for Windows CE - if (testFlag(WithinSetStyle)) - return; const QRect previousGeometry = m_data.geometry; m_data.geometry = geometry_sys(); QPlatformWindow::setGeometry(m_data.geometry); -- cgit v1.2.1