[gnome-terminal] Add debug flag for tracking TerminalWindow's MDI



commit 04d0a0328e42a684a2076563dcc3fcf3847182a5
Author: Christian Persch <chpe gnome org>
Date:   Wed Aug 26 23:11:03 2009 +0200

    Add debug flag for tracking TerminalWindow's MDI

 src/terminal-debug.c  |    1 +
 src/terminal-debug.h  |    3 ++-
 src/terminal-window.c |   23 +++++++++++++++++++++--
 3 files changed, 24 insertions(+), 3 deletions(-)
---
diff --git a/src/terminal-debug.c b/src/terminal-debug.c
index 02cd92c..59b9a00 100644
--- a/src/terminal-debug.c
+++ b/src/terminal-debug.c
@@ -33,6 +33,7 @@ _terminal_debug_init(void)
     { "encodings", TERMINAL_DEBUG_ENCODINGS },
     { "factory",   TERMINAL_DEBUG_FACTORY   },
     { "geometry",  TERMINAL_DEBUG_GEOMETRY  },
+    { "mdi",       TERMINAL_DEBUG_MDI       },
     { "profile",   TERMINAL_DEBUG_PROFILE   }
   };
 
diff --git a/src/terminal-debug.h b/src/terminal-debug.h
index bd482fe..50e870a 100644
--- a/src/terminal-debug.h
+++ b/src/terminal-debug.h
@@ -30,7 +30,8 @@ typedef enum {
   TERMINAL_DEBUG_ENCODINGS  = 1 << 1,
   TERMINAL_DEBUG_FACTORY    = 1 << 2,
   TERMINAL_DEBUG_GEOMETRY   = 1 << 3,
-  TERMINAL_DEBUG_PROFILE    = 1 << 4,
+  TERMINAL_DEBUG_MDI        = 1 << 4,
+  TERMINAL_DEBUG_PROFILE    = 1 << 5,
 } TerminalDebugFlags;
 
 void _terminal_debug_init(void);
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 5785573..2cdac1b 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -2555,7 +2555,11 @@ terminal_window_set_active (TerminalWindow *window,
   TerminalWindowPrivate *priv = window->priv;
   GtkWidget *widget;
   TerminalProfile *profile;
-  
+
+  _terminal_debug_print (TERMINAL_DEBUG_MDI,
+                         "[window %p] MDI: setting active tab to screen %p (old active is %p)\n",
+                         window, screen, priv->active_screen);
+
   if (priv->active_screen == screen)
     return;
   
@@ -2701,6 +2705,10 @@ notebook_page_selected_callback (GtkWidget       *notebook,
   TerminalScreen *screen;
   int old_grid_width, old_grid_height;
 
+  _terminal_debug_print (TERMINAL_DEBUG_MDI,
+                         "[window %p] MDI: page-selected %d\n",
+                         window, page_num);
+
   if (priv->active_screen == NULL || priv->disposed)
     return;
 
@@ -2709,9 +2717,12 @@ notebook_page_selected_callback (GtkWidget       *notebook,
   page_widget = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook),
                                            page_num);
   screen = terminal_screen_container_get_screen (page_widget);
-
   g_assert (screen);
   
+  _terminal_debug_print (TERMINAL_DEBUG_MDI,
+                         "[window %p] MDI: screen %p now the active tab\n",
+                         window, screen);
+
   /* This is so that we maintain the same grid */
   vte_terminal_set_size (VTE_TERMINAL (screen), old_grid_width, old_grid_height);
 
@@ -2730,6 +2741,10 @@ notebook_page_added_callback (GtkWidget       *notebook,
 
   screen = terminal_screen_container_get_screen (container);
 
+  _terminal_debug_print (TERMINAL_DEBUG_MDI,
+                         "[window %p] MDI: screen %p inserted\n",
+                         window, screen);
+
   g_signal_connect (G_OBJECT (screen),
                     "profile-set",
                     G_CALLBACK (profile_set_callback),
@@ -2807,6 +2822,10 @@ notebook_page_removed_callback (GtkWidget       *notebook,
 
   screen = terminal_screen_container_get_screen (container);
 
+  _terminal_debug_print (TERMINAL_DEBUG_MDI,
+                         "[window %p] MDI: screen %p removed\n",
+                         window, screen);
+
   g_signal_handlers_disconnect_by_func (G_OBJECT (screen),
                                         G_CALLBACK (profile_set_callback),
                                         window);



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