Allow to use ForceFullRepaintSync on Linux.
This commit is contained in:
parent
69c8353746
commit
cd4e9d378c
7 changed files with 16 additions and 20 deletions
|
|
@ -23,9 +23,6 @@ inline void DeInitOnTopPanel(not_null<QWidget*> panel) {
|
|||
inline void ReInitOnTopPanel(not_null<QWidget*> panel) {
|
||||
}
|
||||
|
||||
inline void UpdateOverlayed(not_null<QWidget*> widget) {
|
||||
}
|
||||
|
||||
inline void ShowOverAll(not_null<QWidget*> widget, bool canFocus) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@ inline bool TranslucentWindowsSupported() {
|
|||
return true;
|
||||
}
|
||||
|
||||
inline void UpdateOverlayed(not_null<QWidget*> widget) {
|
||||
}
|
||||
|
||||
inline void ClearTransientParent(not_null<QWidget*> widget) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ void InitOnTopPanel(not_null<QWidget*> panel);
|
|||
void DeInitOnTopPanel(not_null<QWidget*> panel);
|
||||
void ReInitOnTopPanel(not_null<QWidget*> panel);
|
||||
|
||||
void UpdateOverlayed(not_null<QWidget*> widget);
|
||||
void ShowOverAll(not_null<QWidget*> widget, bool canFocus = true);
|
||||
void IgnoreAllActivation(not_null<QWidget*> widget);
|
||||
void ClearTransientParent(not_null<QWidget*> widget);
|
||||
|
|
|
|||
|
|
@ -24,18 +24,6 @@ bool IsApplicationActive() {
|
|||
return QApplication::activeWindow() != nullptr;
|
||||
}
|
||||
|
||||
void UpdateOverlayed(not_null<QWidget*> widget) {
|
||||
const auto wm = widget->testAttribute(Qt::WA_Mapped);
|
||||
const auto wv = widget->testAttribute(Qt::WA_WState_Visible);
|
||||
if (!wm) widget->setAttribute(Qt::WA_Mapped, true);
|
||||
if (!wv) widget->setAttribute(Qt::WA_WState_Visible, true);
|
||||
widget->update();
|
||||
QEvent e(QEvent::UpdateRequest);
|
||||
QGuiApplication::sendEvent(widget, &e);
|
||||
if (!wm) widget->setAttribute(Qt::WA_Mapped, false);
|
||||
if (!wv) widget->setAttribute(Qt::WA_WState_Visible, false);
|
||||
}
|
||||
|
||||
void IgnoreAllActivation(not_null<QWidget*> widget) {
|
||||
widget->createWinId();
|
||||
|
||||
|
|
|
|||
|
|
@ -154,6 +154,18 @@ void ForceFullRepaint(not_null<QWidget*> widget) {
|
|||
refresher->show();
|
||||
}
|
||||
|
||||
void ForceFullRepaintSync(not_null<QWidget*> widget) {
|
||||
const auto wm = widget->testAttribute(Qt::WA_Mapped);
|
||||
const auto wv = widget->testAttribute(Qt::WA_WState_Visible);
|
||||
if (!wm) widget->setAttribute(Qt::WA_Mapped, true);
|
||||
if (!wv) widget->setAttribute(Qt::WA_WState_Visible, true);
|
||||
ForceFullRepaint(widget);
|
||||
QEvent e(QEvent::UpdateRequest);
|
||||
QGuiApplication::sendEvent(widget, &e);
|
||||
if (!wm) widget->setAttribute(Qt::WA_Mapped, false);
|
||||
if (!wv) widget->setAttribute(Qt::WA_WState_Visible, false);
|
||||
}
|
||||
|
||||
void PostponeCall(FnMut<void()> &&callable) {
|
||||
Integration::Instance().postponeCall(std::move(callable));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ void RenderWidget(
|
|||
= QWidget::DrawChildren | QWidget::IgnoreMask);
|
||||
|
||||
void ForceFullRepaint(not_null<QWidget*> widget);
|
||||
void ForceFullRepaintSync(not_null<QWidget*> widget);
|
||||
|
||||
void PostponeCall(FnMut<void()> &&callable);
|
||||
|
||||
|
|
|
|||
|
|
@ -1065,7 +1065,9 @@ void PopupMenu::showPrepared(TriggeredSource source) {
|
|||
|
||||
startShowAnimation();
|
||||
|
||||
Platform::UpdateOverlayed(this);
|
||||
if (::Platform::IsWindows()) {
|
||||
ForceFullRepaintSync(this);
|
||||
}
|
||||
show();
|
||||
Platform::ShowOverAll(this);
|
||||
raise();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue