Skip to content

Commit

Permalink
Update Windows CI Qt with patched qwindows [deploy]
Browse files Browse the repository at this point in the history
  • Loading branch information
dougmassay committed Nov 18, 2023
1 parent 090d14e commit 27267d2
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/reset-win-caches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Reset cache on 26-August-2023
Reset cache on 4-September-2023
Reset cache on 9-Semptemeber-2023
Reset cache on 7-October-2023
Reset cache on 18-November-2023
2 changes: 2 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ pre-2.x.x
- assign menu accelerators P - &Plugins, and K - Chec&kpoints (thank you BeckyEbook)
- add ability to change keyboard focus using keyboard shortcuts or menus
to BookBrowser, Preview, CodeView, ClipsWindow, and TableOfContents Windows
Bug Fixes
- patch Qt6.5.3 to avoid transient child window resize bug on Windows

Sigil-2.0.2
Bug Fixes
Expand Down
108 changes: 108 additions & 0 deletions docs/Qt_Patches/qt653_fix_transient_children-qtbase.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
From 614e0f1daa9da2c285e2fd3868f7ebfa9837164c Mon Sep 17 00:00:00 2001
From: Timothée Keller <[email protected]>
Date: Tue, 10 Oct 2023 07:57:09 +0000
Subject: [PATCH] Revert "Windows QPA: Move transient children with a window move"

This reverts commit 530d092eae0579bbb88e95f853715cac214da636.

Reason for revert: Moving transient children as a whole is too broad, and forces unrelated windows to have their position completely dependent on a transient parent.

Fixes: QTBUG-117779
Pick-to: 6.6 6.5
Change-Id: I01312e26e95c8144c392eca33aec41f54aaa40b0
Reviewed-by: Tor Arne Vestbø <[email protected]>
---

diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 295ee93..b095b23 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -944,7 +944,6 @@

result.geometry = obtainedGeometry;
result.restoreGeometry = frameGeometry(result.hwnd, topLevel);
- result.preMoveGeometry = obtainedGeometry;
result.fullFrameMargins = context->margins;
result.embedded = embedded;
result.hasFrame = hasFrame;
@@ -2161,56 +2160,11 @@
}
}

-QWindow *QWindowsWindow::topTransientOf(QWindow *w)
-{
- while (QWindow *transientParent = w->transientParent())
- w = transientParent;
- return w;
-}
-
-void QWindowsWindow::moveTransientChildren()
-{
- // We need the topmost Transient parent since it is the window that will initiate
- // the chain of moves, and is the only one with an already up to date DPI, which we
- // need for the scaling.
- const QWindowsWindow *topTransient = QWindowsWindow::windowsWindowOf(topTransientOf(window()));
-
- const QWindow *currentWindow = window();
- const QWindowList allWindows = QGuiApplication::allWindows();
- for (QWindow *w : allWindows) {
- if (w->transientParent() == currentWindow && w != currentWindow && w->isVisible()) {
- QWindowsWindow *transientChild = QWindowsWindow::windowsWindowOf(w);
-
- RECT oldChildPos{};
- GetWindowRect(transientChild->handle(), &oldChildPos);
- const RECT oldParentPos = RECTfromQRect(preMoveRect());
-
- const qreal scale =
- QHighDpiScaling::roundScaleFactor(qreal(topTransient->savedDpi()) / QWindowsScreen::baseDpi) /
- QHighDpiScaling::roundScaleFactor(qreal(transientChild->savedDpi()) / QWindowsScreen::baseDpi);
-
- const RECT offset =
- RECTfromQRect(QRect(scale * (oldChildPos.left - oldParentPos.left),
- scale * (oldChildPos.top - oldParentPos.top), 0, 0));
- const RECT newParentPos = RECTfromQRect(m_data.geometry);
- const RECT newChildPos { newParentPos.left + offset.left,
- newParentPos.top + offset.top,
- transientChild->geometry().width(),
- transientChild->geometry().height() };
-
- SetWindowPos(transientChild->handle(), nullptr, newChildPos.left, newChildPos.top,
- newChildPos.right, newChildPos.bottom, SWP_NOZORDER | SWP_NOACTIVATE);
- }
- }
-}
-
void QWindowsWindow::handleMoved()
{
- setPreMoveRect(geometry());
// Minimize/Set parent can send nonsensical move events.
if (!IsIconic(m_data.hwnd) && !testFlag(WithinSetParent))
handleGeometryChange();
- moveTransientChildren();
}

void QWindowsWindow::handleResized(int wParam, LPARAM lParam)
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index bd936ec..0d393ec 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -78,7 +78,6 @@
{
Qt::WindowFlags flags;
QRect geometry;
- QRect preMoveGeometry;
QRect restoreGeometry;
QMargins fullFrameMargins; // Do not use directly for windows, see FrameDirty.
QMargins customMargins; // User-defined, additional frame for NCCALCSIZE
@@ -223,11 +222,6 @@
QRect restoreGeometry() const { return m_data.restoreGeometry; }
void updateRestoreGeometry();

- static QWindow *topTransientOf(QWindow *w);
- QRect preMoveRect() const { return m_data.preMoveGeometry; }
- void setPreMoveRect(const QRect &rect) { m_data.preMoveGeometry = rect; }
- void moveTransientChildren();
-
void setVisible(bool visible) override;
bool isVisible() const;
bool isExposed() const override { return testFlag(Exposed); }
2 changes: 1 addition & 1 deletion src/Resource_Files/python_pkg/windows_python_gather6.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# QUiTools needs QtOpenGlWidgets (on Windows anyway)
PYSIDE6_MODULES = [
'QtCore', 'QtGui', 'QtNetwork', 'QtOpenGlWidgets', 'QtPdf', 'QtPrintSupport',
'QtCore', 'QtGui', 'QtNetwork', 'QtOpenGLWidgets', 'QtPdf', 'QtPrintSupport',
'QtUiTools','QtWebEngine', 'QtWebEngineCore', 'QtWebEngineWidgets',
'QtWebChannel', 'QtSvg', 'QtWidgets', 'Shiboken'
]
Expand Down

0 comments on commit 27267d2

Please sign in to comment.