summaryrefslogtreecommitdiff
path: root/libwnck
diff options
context:
space:
mode:
authorArvind Samptur <arvind.samptur@wipro.com>2002-09-27 18:23:20 +0000
committerArvind Samptur <arvind@src.gnome.org>2002-09-27 18:23:20 +0000
commitbd050b6e565ac7bcd0b2118deceb5f39504a4f95 (patch)
tree9172c51d82a0708d6cc4ac0f1b0ae96c1aa9fa7b /libwnck
parent62dbe8af9f12ea8b127b8a8f55c0cacd8ff9d4ab (diff)
downloadlibwnck-bd050b6e565ac7bcd0b2118deceb5f39504a4f95.tar.gz
connect to name_changed on newly created workspace,
2002-09-27 Arvind Samptur <arvind.samptur@wipro.com> * libwnck/pager.c (workspace_create_callback): connect to name_changed on newly created workspace, (workspace_destroyed_callback): disconnect from name_changed, (workspace_name_changed_callback): new function, we queue a resize when a workspace title has been changed, (wnck_pager_connect_screen): connect to name_changed on current workspaces, (wnck_pager_disconnect_screen): disconnect from name_changed on current workspaces. Patch by Kristian Rietveld <kris@gtk.org>. Fixes #84165.
Diffstat (limited to 'libwnck')
-rw-r--r--libwnck/pager.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libwnck/pager.c b/libwnck/pager.c
index c710242..64e2c0c 100644
--- a/libwnck/pager.c
+++ b/libwnck/pager.c
@@ -91,6 +91,8 @@ static gboolean wnck_pager_button_release (GtkWidget *widget,
GdkEventButton *event);
static gboolean wnck_pager_focus (GtkWidget *widget,
GtkDirectionType direction);
+static void workspace_name_changed_callback (WnckWorkspace *workspace,
+ gpointer data);
static void wnck_pager_connect_screen (WnckPager *pager,
WnckScreen *screen);
@@ -1154,6 +1156,8 @@ workspace_created_callback (WnckScreen *screen,
gpointer data)
{
WnckPager *pager = WNCK_PAGER (data);
+ g_signal_connect (space, "name_changed",
+ G_CALLBACK (workspace_name_changed_callback), pager);
gtk_widget_queue_resize (GTK_WIDGET (pager));
}
@@ -1163,6 +1167,7 @@ workspace_destroyed_callback (WnckScreen *screen,
gpointer data)
{
WnckPager *pager = WNCK_PAGER (data);
+ g_signal_handlers_disconnect_by_func (space, G_CALLBACK (workspace_name_changed_callback), pager);
gtk_widget_queue_resize (GTK_WIDGET (pager));
}
@@ -1241,6 +1246,13 @@ background_changed_callback (WnckWindow *window,
}
static void
+workspace_name_changed_callback (WnckWorkspace *space,
+ gpointer data)
+{
+ gtk_widget_queue_resize (GTK_WIDGET (data));
+}
+
+static void
wnck_pager_connect_screen (WnckPager *pager,
WnckScreen *screen)
{
@@ -1313,6 +1325,15 @@ wnck_pager_connect_screen (WnckPager *pager,
++i;
g_assert (i == N_SCREEN_CONNECTIONS);
+
+ /* connect to name_changed on each workspace */
+ for (i = 0; i < wnck_screen_get_workspace_count (pager->priv->screen); i++)
+ {
+ WnckWorkspace *space;
+ space = wnck_screen_get_workspace (pager->priv->screen, i);
+ g_signal_connect (space, "name_changed",
+ G_CALLBACK (workspace_name_changed_callback), pager);
+ }
}
static void
@@ -1356,6 +1377,13 @@ wnck_pager_disconnect_screen (WnckPager *pager)
++i;
}
+ for (i = 0; i < wnck_screen_get_workspace_count (pager->priv->screen); i++)
+ {
+ WnckWorkspace *space;
+ space = wnck_screen_get_workspace (pager->priv->screen, i);
+ g_signal_handlers_disconnect_by_func (space, G_CALLBACK (workspace_name_changed_callback), pager);
+ }
+
pager->priv->screen = NULL;
}