From 4b75381d496060b3cf634d24b23f6122c87f1289 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 29 Jul 2007 20:54:37 +0000 Subject: [PATCH] (svn r10727) -Codechange: when a window would fall outside of the screen (on the right) when opening it, move it to the left so it stays inside the screen. --- src/window.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/window.cpp b/src/window.cpp index e8a6b8802b..a4f215af0d 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);