Prevent context menus from overlapping panels
CHANGELOG: Context menus of applets within a panel no longer overlap the applet REVIEW: 124981
This commit is contained in:
parent
e07778d97b
commit
3eccd9c8a4
@ -885,7 +885,20 @@ void ContainmentInterface::mousePressEvent(QMouseEvent *event)
|
|||||||
if (window() && window()->mouseGrabberItem()) {
|
if (window() && window()->mouseGrabberItem()) {
|
||||||
window()->mouseGrabberItem()->ungrabMouse();
|
window()->mouseGrabberItem()->ungrabMouse();
|
||||||
}
|
}
|
||||||
desktopMenu.exec(event->globalPos());
|
|
||||||
|
QPoint pos = event->globalPos();
|
||||||
|
if (window() && applet && m_containment->containmentType() == Plasma::Types::PanelContainment) {
|
||||||
|
desktopMenu.adjustSize();
|
||||||
|
|
||||||
|
if (QScreen *screen = window()->screen()) {
|
||||||
|
const QRect geo = screen->availableGeometry();
|
||||||
|
|
||||||
|
pos = QPoint(qBound(geo.left(), pos.x(), geo.right() - desktopMenu.width()),
|
||||||
|
qBound(geo.top(), pos.y(), geo.bottom() - desktopMenu.height()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
desktopMenu.exec(pos);
|
||||||
event->setAccepted(true);
|
event->setAccepted(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user