Changeset View
Changeset View
Standalone View
Standalone View
useractions.cpp
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Line(s) | 132 | { | |||
---|---|---|---|---|---|
143 | if (cl->isDesktop() || cl->isDock()) { | 143 | if (cl->isDesktop() || cl->isDock()) { | ||
144 | return; | 144 | return; | ||
145 | } | 145 | } | ||
146 | if (!KAuthorized::authorizeAction(QStringLiteral("kwin_rmb"))) { | 146 | if (!KAuthorized::authorizeAction(QStringLiteral("kwin_rmb"))) { | ||
147 | return; | 147 | return; | ||
148 | } | 148 | } | ||
149 | m_client = cl; | 149 | m_client = cl; | ||
150 | init(); | 150 | init(); | ||
151 | int x = pos.left(); | | |||
152 | int y = pos.bottom(); | | |||
153 | m_client->blockActivityUpdates(true); | 151 | m_client->blockActivityUpdates(true); | ||
154 | if (y != pos.top()) { | | |||
155 | const QRect area = Workspace::self()->clientArea(ScreenArea, QPoint(x, y), | | |||
156 | VirtualDesktopManager::self()->current()); | | |||
157 | menuAboutToShow(); // needed for sizeHint() to be correct :-/ | | |||
158 | int popupHeight = m_menu->sizeHint().height(); | | |||
159 | if (y + popupHeight >= area.height()) { | | |||
160 | y = pos.top() - popupHeight; | | |||
161 | } | | |||
162 | } | | |||
163 | if (kwinApp()->shouldUseWaylandForCompositing()) { | 152 | if (kwinApp()->shouldUseWaylandForCompositing()) { | ||
164 | m_menu->popup(QPoint(x, y)); | 153 | m_menu->popup(pos.bottomLeft()); | ||
zzag: This can be simplified to m_menu->popup(pos.bottomLeft()); | |||||
165 | } else { | 154 | } else { | ||
166 | m_menu->exec(QPoint(x, y)); | 155 | m_menu->exec(pos.bottomLeft()); | ||
167 | } | 156 | } | ||
168 | if (m_client) { | 157 | if (m_client) { | ||
169 | m_client->blockActivityUpdates(false); | 158 | m_client->blockActivityUpdates(false); | ||
170 | } | 159 | } | ||
171 | } | 160 | } | ||
172 | 161 | | |||
173 | void UserActionsMenu::grabInput() | 162 | void UserActionsMenu::grabInput() | ||
174 | { | 163 | { | ||
▲ Show 20 Lines • Show All 1760 Lines • Show Last 20 Lines |
This can be simplified to m_menu->popup(pos.bottomLeft());