[gnome-text-editor] session: add support for "new-window" hint
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-text-editor] session: add support for "new-window" hint
- Date: Thu, 10 Feb 2022 22:01:16 +0000 (UTC)
commit 5ae6d6b56fd934e5ab800d326133de3031ef6d7f
Author: Christian Hergert <chergert redhat com>
Date: Thu Feb 10 14:01:09 2022 -0800
session: add support for "new-window" hint
When opening files with the "new-window" hint, a new window will be created
instead of opening the files in the most-recently-focused window.
Related #312
src/editor-session.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/editor-session.c b/src/editor-session.c
index 607d114..44d3bf2 100644
--- a/src/editor-session.c
+++ b/src/editor-session.c
@@ -1421,10 +1421,15 @@ editor_session_open_files (EditorSession *self,
gint n_files,
const char *hint)
{
+ EditorWindow *window = NULL;
+
g_return_if_fail (EDITOR_IS_SESSION (self));
+ if (g_strcmp0 (hint, "new-window") == 0)
+ window = editor_session_create_window (self);
+
for (guint i = 0; i < n_files; i++)
- editor_session_open (self, NULL, files[i], NULL);
+ editor_session_open (self, window, files[i], NULL);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]