From 4805316c0aefd38e4c60c25cf17c1034c847f944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 9 Nov 2015 13:57:41 +0100 Subject: [PATCH] Use popup instead of exec on useractions menu on Wayland With exec we might hit a dead lock. With popup we don't hit that. Not happy about this change, but well... --- useractions.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/useractions.cpp b/useractions.cpp index 74cb0a4c68..25706ba6d8 100755 --- a/useractions.cpp +++ b/useractions.cpp @@ -144,9 +144,14 @@ void UserActionsMenu::show(const QRect &pos, const QWeakPointer Workspace *ws = Workspace::self(); int x = pos.left(); int y = pos.bottom(); + const bool needsPopup = kwinApp()->shouldUseWaylandForCompositing(); if (y == pos.top()) { m_client.data()->blockActivityUpdates(true); - m_menu->exec(QPoint(x, y)); + if (needsPopup) { + m_menu->popup(QPoint(x, y)); + } else { + m_menu->exec(QPoint(x, y)); + } if (!m_client.isNull()) m_client.data()->blockActivityUpdates(false); } @@ -155,10 +160,19 @@ void UserActionsMenu::show(const QRect &pos, const QWeakPointer QRect area = ws->clientArea(ScreenArea, QPoint(x, y), VirtualDesktopManager::self()->current()); menuAboutToShow(); // needed for sizeHint() to be correct :-/ int popupHeight = m_menu->sizeHint().height(); - if (y + popupHeight < area.height()) - m_menu->exec(QPoint(x, y)); - else - m_menu->exec(QPoint(x, pos.top() - popupHeight)); + if (y + popupHeight < area.height()) { + if (needsPopup) { + m_menu->popup(QPoint(x, y)); + } else { + m_menu->exec(QPoint(x, y)); + } + } else { + if (needsPopup) { + m_menu->popup(QPoint(x, pos.top() - popupHeight)); + } else { + m_menu->exec(QPoint(x, pos.top() - popupHeight)); + } + } if (!m_client.isNull()) m_client.data()->blockActivityUpdates(true); }