win: minor fix
This commit is contained in:
parent
aa489b25d0
commit
2cb8ec0aeb
|
@ -87,6 +87,7 @@ public:
|
|||
bool qpaReady = false;
|
||||
quint32 qpaWaitTime = 0;
|
||||
QTimer repaintTimer{};
|
||||
bool repaintedOnce = false;
|
||||
};
|
||||
|
||||
FRAMELESSHELPER_END_NAMESPACE
|
||||
|
|
|
@ -87,6 +87,7 @@ public:
|
|||
QSizePolicy savedSizePolicy = {};
|
||||
quint32 qpaWaitTime = 0;
|
||||
QTimer repaintTimer{};
|
||||
bool repaintedOnce = false;
|
||||
};
|
||||
|
||||
FRAMELESSHELPER_END_NAMESPACE
|
||||
|
|
|
@ -410,10 +410,7 @@ void FramelessQuickHelperPrivate::repaintAllChildren()
|
|||
void FramelessQuickHelperPrivate::doRepaintAllChildren()
|
||||
{
|
||||
repaintTimer.stop();
|
||||
static bool firstTime = true;
|
||||
if (firstTime) {
|
||||
firstTime = false;
|
||||
} else {
|
||||
if (repaintedOnce) {
|
||||
Q_Q(const FramelessQuickHelper);
|
||||
QQuickWindow *window = q->window();
|
||||
if (!window) {
|
||||
|
@ -423,7 +420,7 @@ void FramelessQuickHelperPrivate::doRepaintAllChildren()
|
|||
// Sync the internal window frame margins with the latest DPI, otherwise
|
||||
// we will get wrong window sizes after the DPI change.
|
||||
std::ignore = Utils::updateInternalWindowFrameMargins(window, true);
|
||||
#endif // Q_OS_WINDOWS
|
||||
#endif // Q_OS_WINDOWS \
|
||||
// No need to repaint the window when it's hidden.
|
||||
if (!window->isVisible()) {
|
||||
return;
|
||||
|
@ -446,6 +443,8 @@ void FramelessQuickHelperPrivate::doRepaintAllChildren()
|
|||
}
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
repaintedOnce = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -375,18 +375,17 @@ void FramelessWidgetsHelperPrivate::repaintAllChildren()
|
|||
void FramelessWidgetsHelperPrivate::doRepaintAllChildren()
|
||||
{
|
||||
repaintTimer.stop();
|
||||
if (repaintedOnce) {
|
||||
if (!window) {
|
||||
return;
|
||||
}
|
||||
static bool firstTime = true;
|
||||
if (firstTime) {
|
||||
firstTime = false;
|
||||
} else {
|
||||
forceWidgetRepaint(window);
|
||||
const QList<QWidget *> widgets = window->findChildren<QWidget *>();
|
||||
for (auto &&widget : std::as_const(widgets)) {
|
||||
forceWidgetRepaint(widget);
|
||||
}
|
||||
} else {
|
||||
repaintedOnce = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue