Commit 844264ea authored by Cedric Bellegarde's avatar Cedric Bellegarde
Browse files

BUG: 309958 We need to send a menuAvailable signal on any WindowRegistered signal

parent 6968a6d5
......@@ -152,9 +152,16 @@ void AppMenuModule::slotAboutToHide()
}
// New window registered
// Do not get importer here as it can freeze module on session loading
void AppMenuModule::slotWindowRegistered(WId id, const QString& service, const QDBusObjectPath& path)
{
if (m_menuStyle == "ButtonVertical") {
// Tell Kwin menu is available
emit menuAvailable(id);
}
if (service == "") { // We do not need to update importer
return;
}
KDBusMenuImporter* importer = m_importers.take(id);
if (importer) {
delete importer;
......@@ -163,11 +170,8 @@ void AppMenuModule::slotWindowRegistered(WId id, const QString& service, const Q
// Put importer in cache
getImporter(id);
if (m_menuStyle == "ButtonVertical") {
// Tell Kwin menu is available
emit menuAvailable(id);
} else if ( m_menuStyle == "TopMenuBar" && id == KWindowSystem::self()->activeWindow()) {
// Application already active so check if we need create menubar
// Application already active so check if we need create menubar
if ( m_menuStyle == "TopMenuBar" && id == KWindowSystem::self()->activeWindow()) {
slotActiveWindowChanged(id);
}
// Send a signal on bus for others dbus interface registrars
......
......@@ -159,7 +159,10 @@ void MenuImporter::RegisterWindow(WId id, const QDBusObjectPath& path)
m_menuServices.insert(id, service);
m_menuPaths.insert(id, path);
m_serviceWatcher->addWatchedService(service);
WindowRegistered(id, service, path);
emit WindowRegistered(id, service, path);
} else {
// Importer do not need to be updated
emit WindowRegistered(id, "", QDBusObjectPath());
}
}
......@@ -169,7 +172,7 @@ void MenuImporter::UnregisterWindow(WId id)
m_menuPaths.remove(id);
m_windowClasses.remove(id);
WindowUnregistered(id);
emit WindowUnregistered(id);
}
QString MenuImporter::GetMenuForWindow(WId id, QDBusObjectPath& path)
......@@ -183,7 +186,7 @@ void MenuImporter::slotServiceUnregistered(const QString& service)
WId id = m_menuServices.key(service);
m_menuServices.remove(id);
m_menuPaths.remove(id);
WindowUnregistered(id);
emit WindowUnregistered(id);
m_serviceWatcher->removeWatchedService(service);
}
......
......@@ -73,6 +73,7 @@ public:
WId recursiveMenuId(WId id);
Q_SIGNALS:
// Empty service means that we do not need to update importer
void WindowRegistered(WId id, const QString& service, const QDBusObjectPath&);
void WindowUnregistered(WId id);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment