summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/webwindow/rekonqmenu.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/webwindow/rekonqmenu.cpp b/src/webwindow/rekonqmenu.cpp
index 4ea01708..42a4af40 100644
--- a/src/webwindow/rekonqmenu.cpp
+++ b/src/webwindow/rekonqmenu.cpp
@@ -49,7 +49,6 @@ void RekonqMenu::showEvent(QShowEvent* event)
// rekonq window to reduce the cases that sub-menus might overlap
// the right screen border.
QPoint position = pos();
- int y = position.y();
int w = width();
@@ -58,7 +57,13 @@ void RekonqMenu::showEvent(QShowEvent* event)
int pw = parentWidget->width();
int px = widgetGlobalPos.x();
- QPoint newPosition = QPoint(px + pw - w, y);
+ // if menu does not overlays right border, do NOT move it
+ int xw = position.x() + w;
+ int pxw = px + pw;
+ if (xw < pxw)
+ return;
+
+ QPoint newPosition = QPoint(px + pw - w, position.y());
// Finally, move it there...
move(newPosition);