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:
parent
25ec024ab5
commit
1296ad3986
1 changed files with 2 additions and 13 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue