win: minor improvements

This commit is contained in:
Yuhang Zhao 2023-11-13 17:29:52 +08:00
parent a1b0568630
commit 5670a28559
4 changed files with 40 additions and 50 deletions

View File

@ -86,7 +86,6 @@ public:
bool qpaReady = false; bool qpaReady = false;
quint32 qpaWaitTime = 0; quint32 qpaWaitTime = 0;
QTimer repaintTimer{}; QTimer repaintTimer{};
bool repaintedOnce = false;
}; };
FRAMELESSHELPER_END_NAMESPACE FRAMELESSHELPER_END_NAMESPACE

View File

@ -86,7 +86,6 @@ public:
QSizePolicy savedSizePolicy = {}; QSizePolicy savedSizePolicy = {};
quint32 qpaWaitTime = 0; quint32 qpaWaitTime = 0;
QTimer repaintTimer{}; QTimer repaintTimer{};
bool repaintedOnce = false;
}; };
FRAMELESSHELPER_END_NAMESPACE FRAMELESSHELPER_END_NAMESPACE

View File

@ -72,7 +72,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
using namespace Global; using namespace Global;
static constexpr const auto kRepaintTimerInterval = 500; static constexpr const auto kRepaintTimerInterval = 300;
struct FramelessQuickHelperExtraData : public FramelessExtraData struct FramelessQuickHelperExtraData : public FramelessExtraData
{ {
@ -414,7 +414,6 @@ void FramelessQuickHelperPrivate::repaintAllChildren()
void FramelessQuickHelperPrivate::doRepaintAllChildren() void FramelessQuickHelperPrivate::doRepaintAllChildren()
{ {
repaintTimer.stop(); repaintTimer.stop();
if (repaintedOnce) {
Q_Q(const FramelessQuickHelper); Q_Q(const FramelessQuickHelper);
QQuickWindow *window = q->window(); QQuickWindow *window = q->window();
if (!window) { if (!window) {
@ -447,9 +446,6 @@ void FramelessQuickHelperPrivate::doRepaintAllChildren()
} }
} }
#endif #endif
} else {
repaintedOnce = true;
}
} }
quint32 FramelessQuickHelperPrivate::readyWaitTime() const quint32 FramelessQuickHelperPrivate::readyWaitTime() const

View File

@ -71,7 +71,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
using namespace Global; using namespace Global;
static constexpr const auto kRepaintTimerInterval = 500; static constexpr const auto kRepaintTimerInterval = 300;
struct FramelessWidgetsHelperExtraData : public FramelessExtraData struct FramelessWidgetsHelperExtraData : public FramelessExtraData
{ {
@ -378,7 +378,6 @@ void FramelessWidgetsHelperPrivate::repaintAllChildren()
void FramelessWidgetsHelperPrivate::doRepaintAllChildren() void FramelessWidgetsHelperPrivate::doRepaintAllChildren()
{ {
repaintTimer.stop(); repaintTimer.stop();
if (repaintedOnce) {
if (!window) { if (!window) {
return; return;
} }
@ -387,9 +386,6 @@ void FramelessWidgetsHelperPrivate::doRepaintAllChildren()
for (auto &&widget : std::as_const(widgets)) { for (auto &&widget : std::as_const(widgets)) {
forceWidgetRepaint(widget); forceWidgetRepaint(widget);
} }
} else {
repaintedOnce = true;
}
} }
quint32 FramelessWidgetsHelperPrivate::readyWaitTime() const quint32 FramelessWidgetsHelperPrivate::readyWaitTime() const