[gnome-builder/wip/gtk4-port: 503/736] plugins/editorui: explicitly check for current workspace
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 503/736] plugins/editorui: explicitly check for current workspace
- Date: Tue, 26 Apr 2022 01:46:29 +0000 (UTC)
commit a7209238cda14bbd02265ba57131649d27c7bb3b
Author: Christian Hergert <chergert redhat com>
Date: Thu Apr 7 12:57:12 2022 -0700
plugins/editorui: explicitly check for current workspace
We sort of relied on this being right before, but I want to make it more
obvious in casual reading.
src/plugins/editorui/gbp-editorui-workbench-addin.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/editorui/gbp-editorui-workbench-addin.c
b/src/plugins/editorui/gbp-editorui-workbench-addin.c
index 21c954d0e..1f5a43c45 100644
--- a/src/plugins/editorui/gbp-editorui-workbench-addin.c
+++ b/src/plugins/editorui/gbp-editorui-workbench-addin.c
@@ -149,7 +149,7 @@ gbp_editorui_workbench_addin_open_cb (GObject *object,
g_autoptr(IdeTask) task = user_data;
g_autoptr(GError) error = NULL;
OpenFileTaskData *state;
- IdeWorkspace *workspace = NULL;
+ IdeWorkspace *workspace;
IDE_ENTRY;
@@ -173,9 +173,16 @@ gbp_editorui_workbench_addin_open_cb (GObject *object,
if (self->workbench == NULL)
IDE_GOTO (failure);
- ide_workbench_foreach_workspace (self->workbench,
- find_preferred_workspace_cb,
- &workspace);
+ workspace = ide_workbench_get_current_workspace (self->workbench);
+
+ if (!IDE_IS_PRIMARY_WORKSPACE (workspace) &&
+ !IDE_IS_EDITOR_WORKSPACE (workspace))
+ {
+ workspace = NULL;
+ ide_workbench_foreach_workspace (self->workbench,
+ find_preferred_workspace_cb,
+ &workspace);
+ }
if (workspace == NULL)
IDE_GOTO (failure);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]