From: rwst Date: Fri, 24 Feb 2006 18:06:37 +0000 (+0000) Subject: make sure no negative dialog position is written into preferences, X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2c2433148c078bfb2f60622e263bbb817e78abdd;p=inkscape.git make sure no negative dialog position is written into preferences, part of fix for #1290647 --- diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp index 084186bf6..afe9cd77f 100644 --- a/src/dialogs/clonetiler.cpp +++ b/src/dialogs/clonetiler.cpp @@ -112,6 +112,9 @@ clonetiler_dialog_delete (GtkObject *object, GdkEvent * /*event*/, gpointer data gtk_window_get_position ((GtkWindow *) dlg, &x, &y); gtk_window_get_size ((GtkWindow *) dlg, &w, &h); + if (x<0) x=0; + if (y<0) y=0; + prefs_set_int_attribute (prefs_path, "x", x); prefs_set_int_attribute (prefs_path, "y", y); prefs_set_int_attribute (prefs_path, "w", w); diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp index 42a084dde..6cd108412 100644 --- a/src/dialogs/export.cpp +++ b/src/dialogs/export.cpp @@ -147,6 +147,9 @@ sp_export_dialog_delete ( GtkObject *object, GdkEvent *event, gpointer data ) gtk_window_get_position ((GtkWindow *) dlg, &x, &y); gtk_window_get_size ((GtkWindow *) dlg, &w, &h); + if (x<0) x=0; + if (y<0) y=0; + prefs_set_int_attribute (prefs_path, "x", x); prefs_set_int_attribute (prefs_path, "y", y); prefs_set_int_attribute (prefs_path, "w", w); diff --git a/src/dialogs/find.cpp b/src/dialogs/find.cpp index 85146f8a3..c1f1c9974 100644 --- a/src/dialogs/find.cpp +++ b/src/dialogs/find.cpp @@ -93,6 +93,9 @@ static gboolean sp_find_dialog_delete(GtkObject *, GdkEvent *, gpointer data) gtk_window_get_position (GTK_WINDOW (dlg), &x, &y); gtk_window_get_size (GTK_WINDOW (dlg), &w, &h); + if (x<0) x=0; + if (y<0) y=0; + prefs_set_int_attribute (prefs_path, "x", x); prefs_set_int_attribute (prefs_path, "y", y); prefs_set_int_attribute (prefs_path, "w", w); diff --git a/src/dialogs/input.cpp b/src/dialogs/input.cpp index 501a4a21b..be6a00542 100644 --- a/src/dialogs/input.cpp +++ b/src/dialogs/input.cpp @@ -49,6 +49,9 @@ sp_input_dialog_delete (GtkObject *object, GdkEvent *event, gpointer data) gtk_window_get_position ((GtkWindow *) dlg, &x, &y); gtk_window_get_size ((GtkWindow *) dlg, &w, &h); + if (x<0) x=0; + if (y<0) y=0; + prefs_set_int_attribute (prefs_path, "x", x); prefs_set_int_attribute (prefs_path, "y", y); prefs_set_int_attribute (prefs_path, "w", w); diff --git a/src/dialogs/item-properties.cpp b/src/dialogs/item-properties.cpp index 7a9b37dcf..da5f7a00c 100644 --- a/src/dialogs/item-properties.cpp +++ b/src/dialogs/item-properties.cpp @@ -70,6 +70,9 @@ sp_item_dialog_delete (GtkObject *object, GdkEvent *event, gpointer data) gtk_window_get_position ((GtkWindow *) dlg, &x, &y); gtk_window_get_size ((GtkWindow *) dlg, &w, &h); + if (x<0) x=0; + if (y<0) y=0; + prefs_set_int_attribute (prefs_path, "x", x); prefs_set_int_attribute (prefs_path, "y", y); prefs_set_int_attribute (prefs_path, "w", w); diff --git a/src/dialogs/object-properties.cpp b/src/dialogs/object-properties.cpp index 9cbf1c3ea..f571c75eb 100644 --- a/src/dialogs/object-properties.cpp +++ b/src/dialogs/object-properties.cpp @@ -68,6 +68,9 @@ sp_object_properties_dialog_delete ( GtkObject *object, gtk_window_get_position ((GtkWindow *) dlg, &x, &y); gtk_window_get_size ((GtkWindow *) dlg, &w, &h); + if (x<0) x=0; + if (y<0) y=0; + prefs_set_int_attribute (prefs_path, "x", x); prefs_set_int_attribute (prefs_path, "y", y); prefs_set_int_attribute (prefs_path, "w", w); diff --git a/src/dialogs/text-edit.cpp b/src/dialogs/text-edit.cpp index 8de2dedac..136cb823d 100644 --- a/src/dialogs/text-edit.cpp +++ b/src/dialogs/text-edit.cpp @@ -100,6 +100,9 @@ sp_text_edit_dialog_delete (GtkObject *object, GdkEvent *event, gpointer data) gtk_window_get_position ((GtkWindow *) dlg, &x, &y); gtk_window_get_size ((GtkWindow *) dlg, &w, &h); + if (x<0) x=0; + if (y<0) y=0; + prefs_set_int_attribute (prefs_path, "x", x); prefs_set_int_attribute (prefs_path, "y", y); prefs_set_int_attribute (prefs_path, "w", w); diff --git a/src/dialogs/xml-tree.cpp b/src/dialogs/xml-tree.cpp index fe51f0144..60845b6bb 100644 --- a/src/dialogs/xml-tree.cpp +++ b/src/dialogs/xml-tree.cpp @@ -913,6 +913,9 @@ static gboolean on_delete(GtkObject *object, GdkEvent *event, gpointer data) gtk_window_get_position((GtkWindow *) dlg, &x, &y); gtk_window_get_size((GtkWindow *) dlg, &w, &h); + if (x<0) x=0; + if (y<0) y=0; + prefs_set_int_attribute(prefs_path, "x", x); prefs_set_int_attribute(prefs_path, "y", y); prefs_set_int_attribute(prefs_path, "w", w); diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp index b4e491bf9..84e69ee24 100644 --- a/src/ui/dialog/dialog.cpp +++ b/src/ui/dialog/dialog.cpp @@ -76,6 +76,9 @@ Dialog::save_geometry() // g_print ("write %d %d %d %d\n", x, y, w, h); + if (x<0) x=0; + if (y<0) y=0; + prefs_set_int_attribute (_prefs_path, "x", x); prefs_set_int_attribute (_prefs_path, "y", y); prefs_set_int_attribute (_prefs_path, "w", w);