[gnome-builder] libide/gui: ignore pages outside grid in MRU



commit 549f9eefd667f03872c76b7cd57060f074585552
Author: Christian Hergert <chergert redhat com>
Date:   Fri Sep 16 11:30:05 2022 -0700

    libide/gui: ignore pages outside grid in MRU

 src/libide/gui/ide-page.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/libide/gui/ide-page.c b/src/libide/gui/ide-page.c
index 5a5cdabc1..a1e54cece 100644
--- a/src/libide/gui/ide-page.c
+++ b/src/libide/gui/ide-page.c
@@ -112,16 +112,22 @@ ide_page_root (GtkWidget *widget)
 {
   IdePage *self = (IdePage *)widget;
   IdePagePrivate *priv = ide_page_get_instance_private (self);
+  g_autoptr(PanelPosition) position = NULL;
   GtkWidget *toplevel;
 
   g_assert (IDE_IS_PAGE (self));
 
   GTK_WIDGET_CLASS (ide_page_parent_class)->root (widget);
 
-  toplevel = GTK_WIDGET (gtk_widget_get_root (widget));
+  /* Ignore any IdePage placed into panels, such as the terminal */
+  if (!(toplevel = GTK_WIDGET (gtk_widget_get_root (widget))) ||
+      !IDE_IS_WORKSPACE (toplevel) ||
+      !(position = panel_widget_get_position (PANEL_WIDGET (widget))) ||
+      !panel_position_get_area_set (position) ||
+      panel_position_get_area (position) != PANEL_AREA_CENTER)
+    return;
 
-  if (IDE_IS_WORKSPACE (toplevel))
-    _ide_workspace_add_page_mru (IDE_WORKSPACE (toplevel), &priv->mru_link);
+  _ide_workspace_add_page_mru (IDE_WORKSPACE (toplevel), &priv->mru_link);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]