Merge branch 'Plasma/5.12'

This commit is contained in:
Kai Uwe Broulik 2018-03-26 10:40:28 +02:00
commit 92276e3629

View file

@ -27,6 +27,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QDBusObjectPath>
#include <QDBusServiceWatcher>
#include "decorations/decorationbridge.h"
#include <KDecoration2/DecorationSettings>
using namespace KWin;
KWIN_SINGLETON_FACTORY(ApplicationMenu)
@ -81,6 +84,13 @@ void ApplicationMenu::setViewEnabled(bool enabled)
void ApplicationMenu::slotShowRequest(const QString &serviceName, const QDBusObjectPath &menuObjectPath, int actionId)
{
// Ignore show request when user has not configured the application menu title bar button
auto decorationSettings = Decoration::DecorationBridge::self()->settings();
if (!decorationSettings->decorationButtonsLeft().contains(KDecoration2::DecorationButtonType::ApplicationMenu)
&& !decorationSettings->decorationButtonsRight().contains(KDecoration2::DecorationButtonType::ApplicationMenu)) {
return;
}
if (AbstractClient *c = findAbstractClientWithApplicationMenu(serviceName, menuObjectPath)) {
c->showApplicationMenu(actionId);
}