Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
[android] Extract main window flashing function
Carsten Hartenfels468aaa5a24da
diff --git a/libs/ui/KisMainWindow.cpp b/libs/ui/KisMainWindow.cppindex 305066ca54..7e4f296ce5 100644--- a/libs/ui/KisMainWindow.cpp+++ b/libs/ui/KisMainWindow.cpp@@ -234,6 +234,9 @@ public:bool firstTime {true};bool windowSizeDirty {false};+#ifdef Q_OS_ANDROID+ bool flashWindowHackInProgress {false};+#endifKisAction *showDocumentInfo {nullptr};KisAction *saveAction {nullptr};@@ -1163,12 +1166,7 @@ KisView* KisMainWindow::addViewAndNotifyLoadingCompleted(KisDocument *document,// opening a document seems to work fine on these devices though, it delays// for a moment then displays fine, so just skip this there I guess.if (!KisAndroidUtils::looksLikeXiaomiDevice()) {- QTimer::singleShot(0, this, [this] {- hide();- QTimer::singleShot(0, this, [this] {- show();- });- });+ slotFlashWindowHack();}#endif@@ -1891,6 +1889,20 @@ void KisMainWindow::slotShowDonationManagementDialog()dlg->show();}}++void KisMainWindow::slotFlashWindowHack()+{+ if (!d->flashWindowHackInProgress) {+ d->flashWindowHackInProgress = true;+ QTimer::singleShot(0, this, [this] {+ hide();+ QTimer::singleShot(0, this, [this] {+ show();+ d->flashWindowHackInProgress = false;+ });+ });+ }+}#endifKoCanvasResourceProvider *KisMainWindow::resourceManager() constdiff --git a/libs/ui/KisMainWindow.h b/libs/ui/KisMainWindow.hindex 005a83c636..74bc2ad472 100644--- a/libs/ui/KisMainWindow.h+++ b/libs/ui/KisMainWindow.h@@ -258,6 +258,7 @@ public Q_SLOTS:#ifdef Q_OS_ANDROIDvoid slotShowDonationManagementDialog();+ void slotFlashWindowHack();#endif/**