changeset 2680:919848e94abc

Addl fix #543: Size of dialog windows in the GTK3 version is too small https://github.com/BestImageViewer/geeqie/issues/543 Prevent duplicate entries when multiple Geeqie windows are opened
author Colin Clark <colin.clark@cclark.uk>
date Tue, 12 Dec 2017 18:51:56 +0000
parents 0645828182a9
children daa8a3b7fb28
files src/ui_utildlg.c
diffstat 1 files changed, 22 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/ui_utildlg.c	Tue Dec 12 13:22:32 2017 +0100
+++ b/src/ui_utildlg.c	Tue Dec 12 18:51:56 2017 +0000
@@ -355,25 +355,30 @@
 {
 	GList *work;
 
-	WRITE_NL(); WRITE_STRING("<%s>", "dialogs");
-	indent++;
-
-	work = g_list_first(dialog_windows);
-	while (work)
+	if (options->save_dialog_window_positions && dialog_windows)
 		{
-		DialogWindow *dw = work->data;
-		WRITE_NL(); WRITE_STRING("<window ");
-		write_char_option(outstr, indent + 1, "title", dw->title);
-		write_char_option(outstr, indent + 1, "role", dw->role);
-		WRITE_INT(*dw, x);
-		WRITE_INT(*dw, y);
-		WRITE_INT(*dw, w);
-		WRITE_INT(*dw, h);
-		WRITE_STRING("/>");
-		work = work->next;
+		WRITE_NL(); WRITE_STRING("<%s>", "dialogs");
+		indent++;
+
+		work = g_list_first(dialog_windows);
+		while (work)
+			{
+			DialogWindow *dw = work->data;
+			WRITE_NL(); WRITE_STRING("<window ");
+			write_char_option(outstr, indent + 1, "title", dw->title);
+			write_char_option(outstr, indent + 1, "role", dw->role);
+			WRITE_INT(*dw, x);
+			WRITE_INT(*dw, y);
+			WRITE_INT(*dw, w);
+			WRITE_INT(*dw, h);
+			WRITE_STRING("/>");
+			work = work->next;
+			}
+		indent--;
+		WRITE_NL(); WRITE_STRING("</%s>", "dialogs");
+
+		dialog_windows = NULL;
 		}
-	indent--;
-	WRITE_NL(); WRITE_STRING("</%s>", "dialogs");
 }
 
 static void generic_dialog_setup(GenericDialog *gd,