Skip to content

Commit

Permalink
Workaround Qt 5.9 build (open-eid#1111)
Browse files Browse the repository at this point in the history
IB-7411

Signed-off-by: Raul Metsma <[email protected]>

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma authored Aug 25, 2022
1 parent 97aca50 commit d3baa13
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
toolset: 14.29
- vcver: 143
image: windows-2022
toolset: 14.32
toolset: 14.33
- vcver: 142
arch: x86
qtver: 5.12.12
Expand Down
17 changes: 15 additions & 2 deletions client/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1109,8 +1109,21 @@ void Application::showClient(const QStringList &params, bool crypto, bool sign,
#ifdef Q_OS_LINUX
else
{
QRect rect = QGuiApplication::screenAt(w->pos())->availableGeometry();
w->move(rect.center() - w->frameGeometry().adjusted(0, 0, 10, 40).center());
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
QScreen *screen = [w]() -> QScreen* {
for (const QScreen *screen : QGuiApplication::screens()) {
for (QScreen *sibling : screen->virtualSiblings()) {
if (sibling->geometry().contains(w->pos()))
return sibling;
}
}
return nullptr;
}();
#else
QScreen *screen = QGuiApplication::screenAt(w->pos());
#endif
if(screen)
w->move(screen->availableGeometry().center() - w->frameGeometry().adjusted(0, 0, 10, 40).center());
}
#endif
}
Expand Down

0 comments on commit d3baa13

Please sign in to comment.