Remove custom menu positioning code

Summary:
Qt will position the menu just fine, this is overhead.
No matter how hard I tried, I couldn't get the menu to show up in a
position where it wasn't shown entirely, removing this should be safe.
Suggested by zzag.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23142
This commit is contained in:
Frederik Gladhorn 2019-08-13 21:41:19 +02:00
parent 25ec024ab5
commit 1296ad3986

View file

@ -148,22 +148,11 @@ void UserActionsMenu::show(const QRect &pos, AbstractClient *client)
}
m_client = cl;
init();
int x = pos.left();
int y = pos.bottom();
m_client->blockActivityUpdates(true);
if (y != pos.top()) {
const QRect area = Workspace::self()->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()) {
y = pos.top() - popupHeight;
}
}
if (kwinApp()->shouldUseWaylandForCompositing()) {
m_menu->popup(QPoint(x, y));
m_menu->popup(pos.bottomLeft());
} else {
m_menu->exec(QPoint(x, y));
m_menu->exec(pos.bottomLeft());
}
if (m_client) {
m_client->blockActivityUpdates(false);