gnome-terminal r2788 - trunk/src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-terminal r2788 - trunk/src
- Date: Thu, 29 May 2008 19:54:24 +0000 (UTC)
Author: chpe
Date: Thu May 29 19:54:24 2008
New Revision: 2788
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=2788&view=rev
Log:
Fix the parent-set handler to account for the terminal screen container, by getting the window when the parent's parent is set.
Modified:
trunk/src/terminal-screen.c
trunk/src/terminal-screen.h
trunk/src/terminal-window.c
Modified: trunk/src/terminal-screen.c
==============================================================================
--- trunk/src/terminal-screen.c (original)
+++ trunk/src/terminal-screen.c Thu May 29 19:54:24 2008
@@ -173,17 +173,46 @@
{
g_print ("screen %p scrolled-window size req %d : %d\n", screen, req->width, req->height);
}
+#endif
static void
-parent_set_callback (TerminalScreen *screen,
- GtkWidget *old_parent)
+parent_parent_set_cb (GtkWidget *widget,
+ GtkWidget *old_parent,
+ TerminalScreen *screen)
+{
+ TerminalScreenPrivate *priv = screen->priv;
+ GtkWidget *toplevel;
+
+ if (widget->parent)
+ {
+ g_return_if_fail (GTK_IS_NOTEBOOK (widget->parent));
+
+ toplevel = gtk_widget_get_toplevel (widget);
+ g_return_if_fail (GTK_WIDGET_TOPLEVEL (toplevel));
+
+ priv->window = TERMINAL_WINDOW (toplevel);
+ }
+ else
+ priv->window = NULL;
+}
+
+static void
+parent_set_callback (GtkWidget *widget,
+ GtkWidget *old_parent)
{
if (old_parent)
+ g_signal_handlers_disconnect_by_func (old_parent, G_CALLBACK (parent_parent_set_cb), widget);
+
+ if (widget->parent)
+ g_signal_connect (widget->parent, "parent-set", G_CALLBACK (parent_parent_set_cb), widget);
+
+#ifdef DEBUG_GEOMETRY
+ if (old_parent)
g_signal_handlers_disconnect_by_func (old_parent, G_CALLBACK (parent_size_request), screen);
if (GTK_WIDGET (screen)->parent)
g_signal_connect (GTK_WIDGET (screen)->parent, "size-request", G_CALLBACK (parent_size_request), screen);
-}
#endif
+}
static void
set_background_image_file (VteTerminal *terminal,
@@ -365,10 +394,11 @@
g_signal_connect (terminal_app_get (), "notify::system-font",
G_CALLBACK (terminal_screen_system_font_notify_cb), screen);
+ g_signal_connect (screen, "parent-set", G_CALLBACK (parent_set_callback), NULL);
+
#ifdef DEBUG_GEOMETRY
g_signal_connect_after (screen, "size-request", G_CALLBACK (size_request), NULL);
g_signal_connect_after (screen, "size-allocate", G_CALLBACK (size_allocate), NULL);
- g_signal_connect (screen, "parent-set", G_CALLBACK (parent_set_callback), NULL);
#endif
gtk_widget_show (GTK_WIDGET (screen)); /* FIXMEchpe remove this */
@@ -572,13 +602,6 @@
return g_object_new (TERMINAL_TYPE_SCREEN, NULL);
}
-void
-terminal_screen_set_window (TerminalScreen *screen,
- TerminalWindow *window)
-{
- screen->priv->window = window;
-}
-
const char*
terminal_screen_get_raw_title (TerminalScreen *screen)
{
Modified: trunk/src/terminal-screen.h
==============================================================================
--- trunk/src/terminal-screen.h (original)
+++ trunk/src/terminal-screen.h Thu May 29 19:54:24 2008
@@ -74,10 +74,6 @@
TerminalScreen* terminal_screen_new (void);
-/* Used in terminal-window.c only, others should call terminal_window_add_screen() */
-void terminal_screen_set_window (TerminalScreen *screen,
- TerminalWindow *window);
-
void terminal_screen_set_profile (TerminalScreen *screen,
TerminalProfile *profile);
TerminalProfile* terminal_screen_get_profile (TerminalScreen *screen);
Modified: trunk/src/terminal-window.c
==============================================================================
--- trunk/src/terminal-window.c (original)
+++ trunk/src/terminal-window.c Thu May 29 19:54:24 2008
@@ -1796,9 +1796,6 @@
screen_container = terminal_screen_container_new (screen);
gtk_widget_show (screen_container);
- // FIXMEchpe remove this once the parent-set handler in TerminalScreen works
- terminal_screen_set_window (screen, window);
-
update_tab_visibility (window, +1);
tab_label = construct_tab_label (screen, screen_container);
@@ -2119,7 +2116,6 @@
screen = terminal_screen_container_get_screen (container);
- terminal_screen_set_window (screen, window);
priv->terms++;
g_signal_connect (G_OBJECT (screen),
@@ -2240,8 +2236,6 @@
G_CALLBACK (screen_close_cb),
window);
- /* FIXMEchpe this should have been done by the parent-set handler already! */
- terminal_screen_set_window (screen, NULL);
priv->terms--;
update_notebook (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]