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;
quint32 qpaWaitTime = 0;
QTimer repaintTimer{};
bool repaintedOnce = false;
};
FRAMELESSHELPER_END_NAMESPACE

View File

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

View File

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

View File

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