[gnome-terminal] Implement a better fix for wrong sizing of detached tabs



commit fd94140f9f0848152932ddf7318a610e37dfc60d
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Fri Oct 8 16:34:03 2010 -0400

    Implement a better fix for wrong sizing of detached tabs
    
    This is a better fix for bug 336325 where a detached notebook
    tab would end up with the wrong size. The problem was essentially
    that the toplevel was being shown when the notebook was in a
    inconsistent state.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=631709

 src/terminal-window.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/terminal-window.c b/src/terminal-window.c
index c396bee..eac169b 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -2287,6 +2287,13 @@ terminal_window_show (GtkWidget *widget)
                          widget_allocation.width, widget_allocation.height,
                          widget_allocation.x, widget_allocation.y);
 
+  /* Because of the unexpected reentrancy caused by notebook_page_added_callback()
+   * showing the TerminalWindow, we can get here when the first page has been
+   * added but not yet set current. By setting the page current, we get the
+   * right size when we first show the window */
+  if (gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook)) == -1)
+    gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), 0);
+
   if (priv->active_screen != NULL)
     {
       /* At this point, we have our GdkScreen, and hence the right



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