Code

Inkscape should not discard negative window positions. For example, a maximized windo...
authordvlierop2 <dvlierop2@users.sourceforge.net>
Sat, 23 May 2009 21:29:52 +0000 (21:29 +0000)
committerdvlierop2 <dvlierop2@users.sourceforge.net>
Sat, 23 May 2009 21:29:52 +0000 (21:29 +0000)
src/interface.cpp
src/sp-namedview.cpp

index 933d407a367db240a6510a38bd01356d83673518..9901c2d6978f6ab8ee5abe3e8e7a2de36559c9df 100644 (file)
@@ -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) {
index 383f35416b6bd2dff691686823d5268167ddfe2b..c9732eece6e0596a4b6460b6ae487dee0cc27d97 100644 (file)
@@ -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));
         }
     }