(svn r12371) -Fix [FS#1823]: do not let window hide behind the main toolbar after resizing the screen
authorsmatz
Sat, 15 Mar 2008 20:32:42 +0000
changeset 9194 685d482d1e6c
parent 9193 95f73a379322
child 9195 b83118d81d4b
(svn r12371) -Fix [FS#1823]: do not let window hide behind the main toolbar after resizing the screen
src/window.cpp
--- a/src/window.cpp	Sat Mar 15 19:50:06 2008 +0000
+++ b/src/window.cpp	Sat Mar 15 20:32:42 2008 +0000
@@ -2175,15 +2175,22 @@
 				IConsoleResize(w);
 				continue;
 
-			default:
+			default: {
 				left = w->left;
 				if (left + (w->width >> 1) >= neww) left = neww - w->width;
 				if (left < 0) left = 0;
 
 				top = w->top;
 				if (top + (w->height >> 1) >= newh) top = newh - w->height;
-				if (top < 0) top = 0;
-				break;
+
+				const Window *wt = FindWindowById(WC_MAIN_TOOLBAR, 0);
+				if (wt != NULL) {
+					if (top < wt->height) top = wt->height;
+					if (top >= newh) top = newh - 1;
+				} else {
+					if (top < 0) top = 0;
+				}
+			} break;
 		}
 
 		if (w->viewport != NULL) {