summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp
index e8a6b8802..a4f215af0 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -689,6 +689,8 @@ static Window *LocalAllocateWindow(
w->wndproc(w, &e);
}
+ if (w->left + w->width > _screen.width) w->left -= (w->left + w->width - _screen.width);
+
const Window *wt = FindWindowById(WC_MAIN_TOOLBAR, 0);
w->top = max(w->top, (wt == NULL || w == wt || y == 0) ? 0 : wt->height);
w->left = max(w->left, 0);