From: dvlierop2 Date: Sat, 23 May 2009 21:29:52 +0000 (+0000) Subject: Inkscape should not discard negative window positions. For example, a maximized windo... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=59ce7a44179e0b794fd92050d79aab7450d8688a;p=inkscape.git Inkscape should not discard negative window positions. For example, a maximized window on Windows XP is at (-4,-4). When ignoring such values, windows might show up at another location when re-opening the file later on (fixes bug #168422) --- diff --git a/src/interface.cpp b/src/interface.cpp index 933d407a3..9901c2d69 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -182,7 +182,7 @@ sp_create_window(SPViewWidget *vw, gboolean editable) gint h = MIN(gdk_screen_height(), ph); gint x = MIN(gdk_screen_width() - MIN_ONSCREEN_DISTANCE, px); gint y = MIN(gdk_screen_height() - MIN_ONSCREEN_DISTANCE, py); - if (w>0 && h>0 && x>0 && y>0) { + if (w>0 && h>0) { x = MIN(gdk_screen_width() - w, x); y = MIN(gdk_screen_height() - h, y); } @@ -196,11 +196,9 @@ sp_create_window(SPViewWidget *vw, gboolean editable) // Empirically it seems that active_desktop==this desktop only the first time a // desktop is created. - if (x>0 && y>0) { - SPDesktop *active_desktop = SP_ACTIVE_DESKTOP; - if (active_desktop == desktop || active_desktop==NULL) { - desktop->setWindowPosition(Geom::Point(x, y)); - } + SPDesktop *active_desktop = SP_ACTIVE_DESKTOP; + if (active_desktop == desktop || active_desktop==NULL) { + desktop->setWindowPosition(Geom::Point(x, y)); } } if (maxed) { diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index 383f35416..c9732eece 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -435,11 +435,11 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va object->requestModified(SP_OBJECT_MODIFIED_FLAG); break; case SP_ATTR_INKSCAPE_WINDOW_X: - nv->window_x = value ? atoi(value) : -1; // -1 means not set + nv->window_x = value ? atoi(value) : 0; object->requestModified(SP_OBJECT_MODIFIED_FLAG); break; case SP_ATTR_INKSCAPE_WINDOW_Y: - nv->window_y = value ? atoi(value) : -1; // -1 means not set + nv->window_y = value ? atoi(value) : 0; object->requestModified(SP_OBJECT_MODIFIED_FLAG); break; case SP_ATTR_INKSCAPE_SNAP_GLOBAL: @@ -750,14 +750,10 @@ void sp_namedview_window_from_document(SPDesktop *desktop) gint h = MIN(gdk_screen_height(), nv->window_height); gint x = MIN(gdk_screen_width() - MIN_ONSCREEN_DISTANCE, nv->window_x); gint y = MIN(gdk_screen_height() - MIN_ONSCREEN_DISTANCE, nv->window_y); - if (w>0 && h>0 && x>0 && y>0) { - x = MIN(gdk_screen_width() - w, x); - y = MIN(gdk_screen_height() - h, y); - } if (w>0 && h>0) { desktop->setWindowSize(w, h); - } - if (x>0 && y>0) { + x = MIN(gdk_screen_width() - w, x); + y = MIN(gdk_screen_height() - h, y); desktop->setWindowPosition(Geom::Point(x, y)); } }