diff --git a/.gitignore b/.gitignore
index d1c8a1d..ea0e4bb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,8 @@
*.so.*
*.dll
*.dylib
+*.orig
+*.rej
# Qt-es
object_script.*.Release
diff --git a/Shutdown/Shutdown_de_DE.ts b/Shutdown/Shutdown_de_DE.ts
index c4ea29b..5224287 100644
--- a/Shutdown/Shutdown_de_DE.ts
+++ b/Shutdown/Shutdown_de_DE.ts
@@ -34,52 +34,52 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/appmenu/appmenumodel.cpp b/src/appmenu/appmenumodel.cpp
index 724c12c..2f2a10f 100644
--- a/src/appmenu/appmenumodel.cpp
+++ b/src/appmenu/appmenumodel.cpp
@@ -40,18 +40,19 @@
#include
#include
#include
+#include
#include
#include
#include
#include
#include
+QMutex mutex;
static const QByteArray s_x11AppMenuServiceNamePropertyName = QByteArrayLiteral("_KDE_NET_WM_APPMENU_SERVICE_NAME");
static const QByteArray s_x11AppMenuObjectPathPropertyName = QByteArrayLiteral("_KDE_NET_WM_APPMENU_OBJECT_PATH");
static QHash s_atoms;
-
void HMenu::actionEvent(QActionEvent *e) {
if(e->type() == QEvent::ActionAdded) {
// probono: Remove mnemonics (underlined characters in menus represented by "&" in code)
@@ -380,6 +381,7 @@ void AppMenuModel::onActiveWindowChanged(WId id)
if(m_serviceName == serviceName &&
m_menuObjectPath == menuObjectPath) {
+ m_pending_service[m_serviceName]=true;
updateApplicationMenu(m_serviceName, m_menuObjectPath);
}else {
m_initialApplicationFromWindowId = -1;
@@ -453,7 +455,10 @@ void AppMenuModel::onActiveWindowChanged(WId id)
qDebug() << serviceName << menuObjectPath << __LINE__ << id;
if (!serviceName.isEmpty() && !menuObjectPath.isEmpty()) {
m_initialApplicationFromWindowId = id;
+ mutex.lock();
+ m_pending_service[m_serviceName]=true;
updateApplicationMenu(serviceName, menuObjectPath);
+ mutex.unlock();
return true;
}
@@ -756,7 +761,10 @@ void AppMenuModel::refreshSearch() {
void AppMenuModel::updateApplicationMenu(const QString &serviceName, const QString &menuObjectPath)
{
-
+ if(m_pending_service[serviceName] && m_serviceName == serviceName) {
+ qDebug() << "Skipping" << serviceName << menuObjectPath <<"switching too fast";
+ return;
+ }
QMenuBar * menuBar = qobject_cast(w_parent);/*m_importers[serviceName+menuObjectPath]->menu()->parent());*/
int cnt = menuBar->actions().count();
QList remove;
@@ -784,7 +792,7 @@ void AppMenuModel::updateApplicationMenu(const QString &serviceName, const QStri
setMenuAvailable(!m_menu.isNull());
- emit menuImported();
+ emit menuImported(serviceName);
}
void AppMenuModel::updateSearch() {
diff --git a/src/appmenu/appmenumodel.h b/src/appmenu/appmenumodel.h
index cf749d2..2eba512 100644
--- a/src/appmenu/appmenumodel.h
+++ b/src/appmenu/appmenumodel.h
@@ -162,6 +162,7 @@ class AppMenuModel : public QAbstractItemModel, public QAbstractNativeEventFilte
MenuRole = Qt::UserRole + 1, // TODO this should be Qt::DisplayRole
ActionRole
};
+ QHash m_pending_service;
QAction *findParent(QAction * child,QAction *root) const ;
/**
@@ -352,7 +353,7 @@ private Q_SLOTS:
signals:
void menuAvailableChanged();
void modelNeedsUpdate();
- void menuImported();
+ void menuImported(QString serviceName);
void firstLevelParsed();
void filterByActiveChanged();
void filterChildrenChanged();
diff --git a/src/appmenuwidget.cpp b/src/appmenuwidget.cpp
index 26bf94b..b335130 100644
--- a/src/appmenuwidget.cpp
+++ b/src/appmenuwidget.cpp
@@ -571,7 +571,8 @@ AppMenuWidget::AppMenuWidget(QWidget *parent)
m_appMenuModel = new AppMenuModel(m_menuBar);
connect(m_appMenuModel,&AppMenuModel::menuAboutToBeImported,this,&AppMenuWidget::menuAboutToBeImported);
- connect(m_appMenuModel,&AppMenuModel::menuImported,this,[this,traverse] {
+ connect(m_appMenuModel,&AppMenuModel::menuImported,this,[this,traverse](QString serviceName) {
+
@@ -582,6 +583,7 @@ AppMenuWidget::AppMenuWidget(QWidget *parent)
iterate(QModelIndex(),m_appMenuModel,traverse);
});
}
+ m_appMenuModel->m_pending_service[serviceName]=false;
});
connect(m_appMenuModel, &AppMenuModel::menuAvailableChanged, this, &AppMenuWidget::updateMenu);
diff --git a/src/translations/menubar_cs.ts b/src/translations/menubar_cs.ts
index d2d75aa..173472e 100644
--- a/src/translations/menubar_cs.ts
+++ b/src/translations/menubar_cs.ts
@@ -9,7 +9,7 @@
Vyhledávání
-
+
O tomto počítači
@@ -47,47 +47,47 @@
Vypnutí
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_da.ts b/src/translations/menubar_da.ts
index a77b365..2a7bf7b 100644
--- a/src/translations/menubar_da.ts
+++ b/src/translations/menubar_da.ts
@@ -11,7 +11,7 @@
AppMenuWidget
-
+
Om denne computer
@@ -54,47 +54,47 @@
Luk ned
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_de.ts b/src/translations/menubar_de.ts
index 60779cd..e8f7a83 100644
--- a/src/translations/menubar_de.ts
+++ b/src/translations/menubar_de.ts
@@ -9,7 +9,7 @@
Suchen
-
+
Über diesen Computer
@@ -47,47 +47,47 @@
Ausschalten
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_el.ts b/src/translations/menubar_el.ts
index a5400ce..8c81e9a 100644
--- a/src/translations/menubar_el.ts
+++ b/src/translations/menubar_el.ts
@@ -9,7 +9,7 @@
Αναζήτηση
-
+
Σχετικά με αυτόν τον υπολογιστή
@@ -47,47 +47,47 @@
Τερματισμός λειτουργίας
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_en.ts b/src/translations/menubar_en.ts
index 3fdb91f..0d38b03 100644
--- a/src/translations/menubar_en.ts
+++ b/src/translations/menubar_en.ts
@@ -9,7 +9,7 @@
Search
-
+
About This Computer
@@ -47,47 +47,47 @@
Shut Down
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_eo.ts b/src/translations/menubar_eo.ts
index 3d6f42f..7d9840a 100644
--- a/src/translations/menubar_eo.ts
+++ b/src/translations/menubar_eo.ts
@@ -11,7 +11,7 @@
AppMenuWidget
-
+
Pri ĉi tiu komputilo
@@ -54,47 +54,47 @@
Malŝalti
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_es.ts b/src/translations/menubar_es.ts
index 4ef9ead..07706f8 100644
--- a/src/translations/menubar_es.ts
+++ b/src/translations/menubar_es.ts
@@ -9,7 +9,7 @@
Buscar
-
+
Sobre este Equipo
@@ -47,47 +47,47 @@
Apagar
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_fr.ts b/src/translations/menubar_fr.ts
index e380691..d73ec1b 100644
--- a/src/translations/menubar_fr.ts
+++ b/src/translations/menubar_fr.ts
@@ -9,7 +9,7 @@
Rechercher
-
+
À propos de cet ordinateur
@@ -47,47 +47,47 @@
Éteindre
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_he.ts b/src/translations/menubar_he.ts
index 59379d0..8563c26 100644
--- a/src/translations/menubar_he.ts
+++ b/src/translations/menubar_he.ts
@@ -9,7 +9,7 @@
חיפוש
-
+
על המחשב הזה
@@ -47,47 +47,47 @@
כיבוי
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_hu.ts b/src/translations/menubar_hu.ts
index 964947e..af1fd33 100644
--- a/src/translations/menubar_hu.ts
+++ b/src/translations/menubar_hu.ts
@@ -9,7 +9,7 @@
Keresés
-
+
A Számítógép Névjegye
@@ -47,47 +47,47 @@
Leállítás
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_it.ts b/src/translations/menubar_it.ts
index 42cacd6..5ec09c0 100644
--- a/src/translations/menubar_it.ts
+++ b/src/translations/menubar_it.ts
@@ -9,7 +9,7 @@
Cerca
-
+
Informazioni su questo computer
@@ -47,47 +47,47 @@
Spegni
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_ja.ts b/src/translations/menubar_ja.ts
index 320f45c..074d090 100644
--- a/src/translations/menubar_ja.ts
+++ b/src/translations/menubar_ja.ts
@@ -32,7 +32,7 @@
検索
-
+
このコンピューターについて
@@ -70,47 +70,47 @@
シャットダウン
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_ka.ts b/src/translations/menubar_ka.ts
index b8a7cfa..c6b6ea1 100644
--- a/src/translations/menubar_ka.ts
+++ b/src/translations/menubar_ka.ts
@@ -9,7 +9,7 @@
ძებნა
-
+
ამ კომპიუტერის შესახებ
@@ -47,47 +47,47 @@
Გათიშვა
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_ko.ts b/src/translations/menubar_ko.ts
index 2fd793c..989dc91 100644
--- a/src/translations/menubar_ko.ts
+++ b/src/translations/menubar_ko.ts
@@ -32,7 +32,7 @@
검색
-
+
이 컴퓨터 정보
@@ -70,47 +70,47 @@
끄세요
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_lt.ts b/src/translations/menubar_lt.ts
index 0032798..eaef395 100644
--- a/src/translations/menubar_lt.ts
+++ b/src/translations/menubar_lt.ts
@@ -9,7 +9,7 @@
Paieška
-
+
Apie šį kompiuterį
@@ -47,47 +47,47 @@
Išjungti
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_nb_NO.ts b/src/translations/menubar_nb_NO.ts
index 93044eb..5c18447 100644
--- a/src/translations/menubar_nb_NO.ts
+++ b/src/translations/menubar_nb_NO.ts
@@ -32,7 +32,7 @@
Søk
-
+
Om denne datamaskinen
@@ -70,47 +70,47 @@
Slå av
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_nl.ts b/src/translations/menubar_nl.ts
index 87c212a..8a4b9f6 100644
--- a/src/translations/menubar_nl.ts
+++ b/src/translations/menubar_nl.ts
@@ -9,7 +9,7 @@
Zoeken
-
+
Over deze computer
@@ -47,47 +47,47 @@
Zet uit
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_pl.ts b/src/translations/menubar_pl.ts
index d1ea85c..8418999 100644
--- a/src/translations/menubar_pl.ts
+++ b/src/translations/menubar_pl.ts
@@ -32,7 +32,7 @@
Szukaj
-
+
O tym komputerze
@@ -70,47 +70,47 @@
Wyłącz komputer
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_pt.ts b/src/translations/menubar_pt.ts
index e5bb09d..d432095 100644
--- a/src/translations/menubar_pt.ts
+++ b/src/translations/menubar_pt.ts
@@ -32,7 +32,7 @@
Procurar
-
+
Acerca deste computador
@@ -70,47 +70,47 @@
Desligar
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_pt_BR.ts b/src/translations/menubar_pt_BR.ts
index 3a154de..a83b267 100644
--- a/src/translations/menubar_pt_BR.ts
+++ b/src/translations/menubar_pt_BR.ts
@@ -9,7 +9,7 @@
Pesquisar
-
+
Sobre Esse Computador
@@ -47,47 +47,47 @@
Desligar
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_ru.ts b/src/translations/menubar_ru.ts
index 28c54c0..92c8393 100644
--- a/src/translations/menubar_ru.ts
+++ b/src/translations/menubar_ru.ts
@@ -9,7 +9,7 @@
Поиск
-
+
О компьютере
@@ -47,47 +47,47 @@
Завершение работы
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_sl.ts b/src/translations/menubar_sl.ts
index 25dd95a..5c116b0 100644
--- a/src/translations/menubar_sl.ts
+++ b/src/translations/menubar_sl.ts
@@ -9,7 +9,7 @@
Išči
-
+
O tem računalniku
@@ -47,47 +47,47 @@
Izklopi
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_sv.ts b/src/translations/menubar_sv.ts
index edeba15..26ea095 100644
--- a/src/translations/menubar_sv.ts
+++ b/src/translations/menubar_sv.ts
@@ -9,7 +9,7 @@
Sök
-
+
Om Denna dator
@@ -47,47 +47,47 @@
Stäng av
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_tr.ts b/src/translations/menubar_tr.ts
index 89a1276..62e7461 100644
--- a/src/translations/menubar_tr.ts
+++ b/src/translations/menubar_tr.ts
@@ -32,7 +32,7 @@
Ara
-
+
Bu bilgisayar hakkında
@@ -70,47 +70,47 @@
Kapat
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_uk.ts b/src/translations/menubar_uk.ts
index 49219b4..476febd 100644
--- a/src/translations/menubar_uk.ts
+++ b/src/translations/menubar_uk.ts
@@ -9,7 +9,7 @@
Пошук
-
+
Про цей Комп'ютер
@@ -47,47 +47,47 @@
Вимкнути
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_zh_Hans.ts b/src/translations/menubar_zh_Hans.ts
index 204632a..11cf305 100644
--- a/src/translations/menubar_zh_Hans.ts
+++ b/src/translations/menubar_zh_Hans.ts
@@ -9,7 +9,7 @@
搜索
-
+
关于此电脑
@@ -47,47 +47,47 @@
关机
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/translations/menubar_zh_Hant.ts b/src/translations/menubar_zh_Hant.ts
index 309fe90..af4807a 100644
--- a/src/translations/menubar_zh_Hant.ts
+++ b/src/translations/menubar_zh_Hant.ts
@@ -32,7 +32,7 @@
搜尋
-
+
關於這台電腦
@@ -70,47 +70,47 @@
關機
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+