diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2009-06-06 19:46:23 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2009-06-06 19:46:23 +0000 |
| commit | 32f93629f67bb88c64cbcc543438b349e89c097e (patch) | |
| tree | b62a3b68c0134228b00784b478a267fd8c508c46 /src/sp-namedview.cpp | |
| parent | Better Gelatine (diff) | |
| download | inkscape-32f93629f67bb88c64cbcc543438b349e89c097e.tar.gz inkscape-32f93629f67bb88c64cbcc543438b349e89c097e.zip | |
Make sure that when opening a window, this window is positioned within the boundaries set by the screen resolution. Before only right / bottom where checked, but now also top / left are checked (see bug #168422)
(bzr r8012)
Diffstat (limited to 'src/sp-namedview.cpp')
| -rw-r--r-- | src/sp-namedview.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index 15f2d6d72..47720c5d6 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -745,12 +745,14 @@ void sp_namedview_window_from_document(SPDesktop *desktop) } 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)); } } |
