Fix #734: Starting with --remote --new-window opens two windows
authorColin Clark <cclark@carbon>
Tue, 24 Dec 2019 16:35:58 +0000 (16:35 +0000)
committerColin Clark <cclark@carbon>
Tue, 24 Dec 2019 16:35:58 +0000 (16:35 +0000)
https://github.com/BestImageViewer/geeqie/issues/734

If Geeqie is not running, remove --new-window from the remote command
list.

src/remote.c

index 17a64d5..e926fe8 100644 (file)
@@ -1430,6 +1430,11 @@ void remote_control(const gchar *arg_exec, GList *remote_list, const gchar *path
                        entry = remote_command_find(text, NULL);
                        if (entry)
                                {
+                               /* If Geeqie is not running, stop the --new-window command opening a second window */
+                               if (g_strcmp0(text, "--new-window") == 0)
+                                       {
+                                       remote_list = g_list_remove(remote_list, text);
+                                       }
                                if (entry->prefer_command_line)
                                        {
                                        remote_list = g_list_remove(remote_list, text);