From 69d270fec638055afb0f4d6037b1e7d6bd7d10be Mon Sep 17 00:00:00 2001 From: rwst Date: Fri, 24 Feb 2006 18:33:07 +0000 Subject: [PATCH] make sure only positive dialog positions are read from preferences, fixes #1290647 --- src/dialogs/clonetiler.cpp | 3 +++ src/dialogs/export.cpp | 3 +++ src/dialogs/find.cpp | 4 ++++ src/dialogs/input.cpp | 3 +++ src/dialogs/item-properties.cpp | 3 +++ src/dialogs/object-properties.cpp | 4 ++++ src/dialogs/text-edit.cpp | 3 +++ src/dialogs/xml-tree.cpp | 4 ++++ src/ui/dialog/dialog.cpp | 3 +++ src/widgets/gradient-vector.cpp | 4 ++++ 10 files changed, 34 insertions(+) diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp index afe9cd77f..304bf7c0e 100644 --- a/src/dialogs/clonetiler.cpp +++ b/src/dialogs/clonetiler.cpp @@ -1583,6 +1583,9 @@ clonetiler_dialog (void) h = prefs_get_int_attribute (prefs_path, "h", 0); } + if (x<0) x=0; + if (y<0) y=0; + if (x != 0 || y != 0) { gtk_window_move ((GtkWindow *) dlg, x, y); diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp index 6cd108412..54df64782 100644 --- a/src/dialogs/export.cpp +++ b/src/dialogs/export.cpp @@ -348,6 +348,9 @@ sp_export_dialog (void) h = prefs_get_int_attribute (prefs_path, "h", 0); } + if (x<0) x=0; + if (y<0) y=0; + if (x != 0 || y != 0) { gtk_window_move ((GtkWindow *) dlg, x, y); } else { diff --git a/src/dialogs/find.cpp b/src/dialogs/find.cpp index c1f1c9974..c76390ccb 100644 --- a/src/dialogs/find.cpp +++ b/src/dialogs/find.cpp @@ -652,6 +652,10 @@ sp_find_dialog_old (void) w = prefs_get_int_attribute (prefs_path, "w", 0); h = prefs_get_int_attribute (prefs_path, "h", 0); } + + if (x<0) x=0; + if (y<0) y=0; + if (x != 0 || y != 0) { gtk_window_move ((GtkWindow *) dlg, x, y); } else { diff --git a/src/dialogs/input.cpp b/src/dialogs/input.cpp index be6a00542..eac3a0c5a 100644 --- a/src/dialogs/input.cpp +++ b/src/dialogs/input.cpp @@ -230,6 +230,9 @@ sp_input_dialog (void) h = prefs_get_int_attribute (prefs_path, "h", 0); } + if (x<0) x=0; + if (y<0) y=0; + if (x != 0 || y != 0) { gtk_window_move ((GtkWindow *) dlg, x, y); } else { diff --git a/src/dialogs/item-properties.cpp b/src/dialogs/item-properties.cpp index da5f7a00c..50027e2fa 100644 --- a/src/dialogs/item-properties.cpp +++ b/src/dialogs/item-properties.cpp @@ -455,6 +455,9 @@ sp_item_dialog (void) h = prefs_get_int_attribute (prefs_path, "h", 0); } + if (x<0) x=0; + if (y<0) y=0; + if (x != 0 || y != 0) { gtk_window_move ((GtkWindow *) dlg, x, y); } else { diff --git a/src/dialogs/object-properties.cpp b/src/dialogs/object-properties.cpp index f571c75eb..f4a40cd28 100644 --- a/src/dialogs/object-properties.cpp +++ b/src/dialogs/object-properties.cpp @@ -122,6 +122,10 @@ sp_object_properties_dialog (void) w = prefs_get_int_attribute (prefs_path, "w", 0); h = prefs_get_int_attribute (prefs_path, "h", 0); } + + if (x<0) x=0; + if (y<0) y=0; + if (x != 0 || y != 0) gtk_window_move ((GtkWindow *) dlg, x, y); else diff --git a/src/dialogs/text-edit.cpp b/src/dialogs/text-edit.cpp index 136cb823d..9d8fe5ced 100644 --- a/src/dialogs/text-edit.cpp +++ b/src/dialogs/text-edit.cpp @@ -154,6 +154,9 @@ sp_text_edit_dialog (void) h = prefs_get_int_attribute (prefs_path, "h", 0); } + if (x<0) x=0; + if (y<0) y=0; + if (x != 0 || y != 0) { gtk_window_move ((GtkWindow *) dlg, x, y); } else { diff --git a/src/dialogs/xml-tree.cpp b/src/dialogs/xml-tree.cpp index 60845b6bb..44426d921 100644 --- a/src/dialogs/xml-tree.cpp +++ b/src/dialogs/xml-tree.cpp @@ -217,6 +217,10 @@ void sp_xml_tree_dialog() w = prefs_get_int_attribute(prefs_path, "w", 0); h = prefs_get_int_attribute(prefs_path, "h", 0); } + + if (x<0) x=0; + if (y<0) y=0; + if (x != 0 || y != 0) { gtk_window_move((GtkWindow *) dlg, x, y); } else { diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp index 84e69ee24..238c6d9f7 100644 --- a/src/ui/dialog/dialog.cpp +++ b/src/ui/dialog/dialog.cpp @@ -97,6 +97,9 @@ Dialog::read_geometry() // g_print ("read %d %d %d %d\n", x, y, w, h); + if (x<0) x=0; + if (y<0) y=0; + // If there are stored height and width values for the dialog, // resize the window to match; otherwise we leave it at its default if (w != 0 && h != 0) { diff --git a/src/widgets/gradient-vector.cpp b/src/widgets/gradient-vector.cpp index 15c19da0e..2917ab89d 100644 --- a/src/widgets/gradient-vector.cpp +++ b/src/widgets/gradient-vector.cpp @@ -878,6 +878,10 @@ sp_gradient_vector_editor_new (SPGradient *gradient, SPStop *stop) w = prefs_get_int_attribute (prefs_path, "w", 0); h = prefs_get_int_attribute (prefs_path, "h", 0); } + + if (x<0) x=0; + if (y<0) y=0; + if (x != 0 || y != 0) gtk_window_move ((GtkWindow *) dlg, x, y); else -- 2.30.2