Commit fac24225 authored by Xaver Hugl's avatar Xaver Hugl

Add a QRect to requestShowWindowMenu

parent f6367b9d
......@@ -182,7 +182,7 @@ void MockClient::requestMinimize()
emit minimizeRequested();
}
void MockClient::requestShowWindowMenu()
void MockClient::requestShowWindowMenu(const QRect &rect)
{
emit menuRequested();
}
......
......@@ -45,7 +45,7 @@ public:
void requestContextHelp() override;
void requestToggleMaximization(Qt::MouseButtons buttons) override;
void requestMinimize() override;
void requestShowWindowMenu() override;
void requestShowWindowMenu(const QRect &rect) override;
void requestShowApplicationMenu(const QRect &rect, int actionId) override;
void requestToggleKeepAbove() override;
void requestToggleKeepBelow() override;
......
......@@ -161,10 +161,14 @@ DELEGATE(requestToggleOnAllDesktops)
DELEGATE(requestToggleShade)
DELEGATE(requestToggleKeepAbove)
DELEGATE(requestToggleKeepBelow)
DELEGATE(requestShowWindowMenu)
#undef DELEGATE
void Decoration::requestShowWindowMenu(const QRect &rect)
{
d->client->d->requestShowWindowMenu(rect);
}
void Decoration::requestShowToolTip(const QString &text)
{
d->client->d->requestShowToolTip(text);
......
......@@ -161,7 +161,7 @@ public Q_SLOTS:
void requestToggleShade();
void requestToggleKeepAbove();
void requestToggleKeepBelow();
void requestShowWindowMenu();
void requestShowWindowMenu(const QRect &rect);
void requestShowToolTip(const QString &text);
void requestHideToolTip();
......
......@@ -56,7 +56,10 @@ void DecorationButton::Private::init()
auto settings = decoration->settings();
switch (type) {
case DecorationButtonType::Menu:
QObject::connect(q, &DecorationButton::clicked, decoration.data(), &Decoration::requestShowWindowMenu, Qt::QueuedConnection);
QObject::connect(q, &DecorationButton::clicked, decoration.data(), [this](Qt::MouseButton button){
Q_UNUSED(button)
decoration->requestShowWindowMenu(q->geometry().toRect());
}, Qt::QueuedConnection);
QObject::connect(q, &DecorationButton::doubleClicked, decoration.data(), &Decoration::requestClose, Qt::QueuedConnection);
QObject::connect(settings.data(), &DecorationSettings::closeOnDoubleClickOnMenuChanged, q,
[this](bool enabled) {
......
......@@ -73,7 +73,7 @@ public:
virtual void requestToggleShade() = 0;
virtual void requestToggleKeepAbove() = 0;
virtual void requestToggleKeepBelow() = 0;
virtual void requestShowWindowMenu() = 0;
virtual void requestShowWindowMenu(const QRect &rect) = 0;
Decoration *decoration();
Decoration *decoration() const;
......
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