[gnome-builder] plugins/debuggerui: raise debug panel when debug tool starts
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] plugins/debuggerui: raise debug panel when debug tool starts
- Date: Sat, 24 Sep 2022 18:47:25 +0000 (UTC)
commit c2177fb5adb48d7ec99f4e63f07598827aa29e28
Author: Christian Hergert <chergert redhat com>
Date: Sat Sep 24 11:47:14 2022 -0700
plugins/debuggerui: raise debug panel when debug tool starts
src/plugins/debuggerui/gbp-debugger-tool.c | 14 +++++++++++++-
src/plugins/debuggerui/ide-debugger-workspace-addin.c | 14 ++++++++++++++
src/plugins/debuggerui/ide-debugger-workspace-addin.h | 9 +++++----
3 files changed, 32 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/debuggerui/gbp-debugger-tool.c b/src/plugins/debuggerui/gbp-debugger-tool.c
index cce27695e..8e29c7e85 100644
--- a/src/plugins/debuggerui/gbp-debugger-tool.c
+++ b/src/plugins/debuggerui/gbp-debugger-tool.c
@@ -23,10 +23,12 @@
#include "config.h"
#include <libide-debugger.h>
+#include <libide-gui.h>
#include "ide-debug-manager-private.h"
#include "gbp-debugger-tool.h"
+#include "ide-debugger-workspace-addin.h"
struct _GbpDebuggerTool
{
@@ -90,7 +92,10 @@ gbp_debugger_tool_started (IdeRunTool *run_tool,
IdeSubprocess *subprocess)
{
GbpDebuggerTool *self = (GbpDebuggerTool *)run_tool;
+ IdeWorkspaceAddin *addin;
IdeDebugManager *debug_manager;
+ IdeWorkbench *workbench;
+ IdeWorkspace *workspace;
IdeContext *context;
IDE_ENTRY;
@@ -100,8 +105,15 @@ gbp_debugger_tool_started (IdeRunTool *run_tool,
g_assert (IDE_IS_SUBPROCESS (subprocess));
context = ide_object_get_context (IDE_OBJECT (self));
- debug_manager = ide_debug_manager_from_context (context);
+ /* Make sure controls are visible to user */
+ workbench = ide_workbench_from_context (context);
+ workspace = ide_workbench_get_workspace_by_type (workbench, IDE_TYPE_PRIMARY_WORKSPACE);
+ addin = ide_workspace_addin_find_by_module_name (workspace, "debuggerui");
+ ide_debugger_workspace_addin_raise_panel (IDE_DEBUGGER_WORKSPACE_ADDIN (addin));
+
+ /* Notify debug manager we've started so it can sync breakpoints */
+ debug_manager = ide_debug_manager_from_context (context);
_ide_debug_manager_started (debug_manager);
IDE_EXIT;
diff --git a/src/plugins/debuggerui/ide-debugger-workspace-addin.c
b/src/plugins/debuggerui/ide-debugger-workspace-addin.c
index a9d22dacf..e053c40d4 100644
--- a/src/plugins/debuggerui/ide-debugger-workspace-addin.c
+++ b/src/plugins/debuggerui/ide-debugger-workspace-addin.c
@@ -502,3 +502,17 @@ ide_debugger_workspace_addin_navigate_to_breakpoint (IdeDebuggerWorkspaceAddin *
IDE_EXIT;
}
+
+void
+ide_debugger_workspace_addin_raise_panel (IdeDebuggerWorkspaceAddin *self)
+{
+ IDE_ENTRY;
+
+ g_return_if_fail (IDE_IS_MAIN_THREAD ());
+ g_return_if_fail (IDE_IS_DEBUGGER_WORKSPACE_ADDIN (self));
+ g_return_if_fail (IDE_IS_PANE (self->panel));
+
+ panel_widget_raise (PANEL_WIDGET (self->panel));
+
+ IDE_EXIT;
+}
diff --git a/src/plugins/debuggerui/ide-debugger-workspace-addin.h
b/src/plugins/debuggerui/ide-debugger-workspace-addin.h
index b4b70b5bb..a7d0ce14c 100644
--- a/src/plugins/debuggerui/ide-debugger-workspace-addin.h
+++ b/src/plugins/debuggerui/ide-debugger-workspace-addin.h
@@ -28,12 +28,13 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (IdeDebuggerWorkspaceAddin, ide_debugger_workspace_addin, IDE,
DEBUGGER_WORKSPACE_ADDIN, GObject)
+void ide_debugger_workspace_addin_raise_panel (IdeDebuggerWorkspaceAddin *self);
void ide_debugger_workspace_addin_navigate_to_address (IdeDebuggerWorkspaceAddin *self,
- IdeDebuggerAddress address);
+ IdeDebuggerAddress address);
void ide_debugger_workspace_addin_navigate_to_breakpoint (IdeDebuggerWorkspaceAddin *self,
- IdeDebuggerBreakpoint *breakpoint);
+ IdeDebuggerBreakpoint *breakpoint);
void ide_debugger_workspace_addin_navigate_to_file (IdeDebuggerWorkspaceAddin *self,
- GFile *file,
- guint line);
+ GFile *file,
+ guint line);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]