summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b64c720)
raw | patch | inline | side by side (parent: b64c720)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Sat, 6 Jun 2009 19:46:23 +0000 (19:46 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Sat, 6 Jun 2009 19:46:23 +0000 (19:46 +0000) |
src/sp-namedview.cpp | patch | blob | history |
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp
index 15f2d6d725d9a2658e302bac6bbf3589a16924ae..47720c5d64f12fb9409e1f74aa7a537b457d0fe8 100644 (file)
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
} else {
gint w = MIN(gdk_screen_width(), nv->window_width);
gint h = MIN(gdk_screen_height(), nv->window_height);
+ // prevent the window from moving off the screen to the right or to the bottom
gint x = MIN(gdk_screen_width() - MIN_ONSCREEN_DISTANCE, nv->window_x);
gint y = MIN(gdk_screen_height() - MIN_ONSCREEN_DISTANCE, nv->window_y);
+ // prevent the window from moving off the screen to the left or to the top
+ x = MAX(MIN_ONSCREEN_DISTANCE - nv->window_width, x);
+ y = MAX(MIN_ONSCREEN_DISTANCE - nv->window_height, y);
if (w>0 && h>0) {
desktop->setWindowSize(w, h);
- x = MIN(gdk_screen_width() - w, x);
- y = MIN(gdk_screen_height() - h, y);
desktop->setWindowPosition(Geom::Point(x, y));
}
}