--- panel/panel-item-dialog.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) Index: xfce4-panel-4.10.0/panel/panel-item-dialog.c =================================================================== --- xfce4-panel-4.10.0.orig/panel/panel-item-dialog.c 2012-04-28 16:31:35.000000000 -0400 +++ xfce4-panel-4.10.0/panel/panel-item-dialog.c 2013-02-09 23:30:20.000000000 -0500 @@ -52,6 +52,7 @@ static void panel_item_dialog_re static void panel_item_dialog_unique_changed (PanelModuleFactory *factory, PanelModule *module, PanelItemDialog *dialog); +static void panel_item_dialog_unique_refresh (PanelItemDialog *dialog); static gboolean panel_item_dialog_unique_changed_foreach (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, @@ -369,6 +370,23 @@ panel_item_dialog_unique_changed (PanelM +static void +panel_item_dialog_unique_refresh (PanelItemDialog *dialog) +{ + panel_return_if_fail (PANEL_IS_ITEM_DIALOG (dialog)); + panel_return_if_fail (GTK_IS_LIST_STORE (dialog->store)); + + /* update all module sensitivity */ + g_object_set_data (G_OBJECT (dialog->store), "dialog", dialog); + gtk_tree_model_foreach (GTK_TREE_MODEL (dialog->store), + panel_item_dialog_unique_changed_foreach, NULL); + g_object_set_data (G_OBJECT (dialog->store), "dialog", NULL); + + /* update button sensitivity */ + panel_item_dialog_selection_changed (gtk_tree_view_get_selection (dialog->treeview), dialog); +} + + static gboolean panel_item_dialog_unique_changed_foreach (GtkTreeModel *model, GtkTreePath *path, @@ -379,7 +397,7 @@ panel_item_dialog_unique_changed_foreach gboolean result; GtkWidget *dialog; - panel_return_val_if_fail (PANEL_IS_MODULE (user_data), FALSE); + panel_return_val_if_fail (user_data == NULL || PANEL_IS_MODULE (user_data), FALSE); /* get the module of this iter */ gtk_tree_model_get (model, iter, COLUMN_MODULE, &module, -1); @@ -391,7 +409,7 @@ panel_item_dialog_unique_changed_foreach /* check if this is the module we're looking for */ result = !!(module == PANEL_MODULE (user_data)); - if (result) + if (result || user_data == NULL) { dialog = g_object_get_data (G_OBJECT (model), "dialog"); panel_return_val_if_fail (PANEL_IS_ITEM_DIALOG (dialog), FALSE); @@ -777,6 +795,7 @@ void panel_item_dialog_show (PanelWindow *window) { GdkScreen *screen; + GdkScreen *old_screen; PanelApplication *application; panel_return_if_fail (window == NULL || PANEL_IS_WINDOW (window)); @@ -791,6 +810,7 @@ panel_item_dialog_show (PanelWindow *win dialog_singleton = g_object_new (PANEL_TYPE_ITEM_DIALOG, NULL); g_object_add_weak_pointer (G_OBJECT (dialog_singleton), (gpointer) &dialog_singleton); } + old_screen = gtk_widget_get_screen (GTK_WIDGET (dialog_singleton)); /* show the dialog on the same screen as the panel */ if (G_UNLIKELY (window != NULL)) @@ -809,6 +829,10 @@ panel_item_dialog_show (PanelWindow *win } gtk_window_set_screen (GTK_WINDOW (dialog_singleton), screen); + if (old_screen != screen) + { + panel_item_dialog_unique_refresh (dialog_singleton); + } /* focus the window */ gtk_window_present (GTK_WINDOW (dialog_singleton));