[gnome-panel] panel: Fix warning when recreating panel context menu
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] panel: Fix warning when recreating panel context menu
- Date: Wed, 23 Feb 2011 10:32:01 +0000 (UTC)
commit 896d07f06816437b9b1bc11f54a9d3a2549a1a26
Author: Vincent Untz <vuntz gnome org>
Date: Wed Feb 23 11:08:48 2011 +0100
panel: Fix warning when recreating panel context menu
If the menu was recreated because of a locked-down change, then the menu
was deactivated while it was not open; this created a warning in our
deactivated handler.
gnome-panel/panel.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gnome-panel/panel.c b/gnome-panel/panel.c
index f8c0f79..90cfc51 100644
--- a/gnome-panel/panel.c
+++ b/gnome-panel/panel.c
@@ -256,8 +256,15 @@ context_menu_show (GtkWidget *w,
static void
panel_recreate_context_menu (PanelData *pd)
{
- if (pd->menu)
+ if (pd->menu) {
+ if (gtk_widget_get_visible (pd->menu))
+ gtk_menu_shell_deactivate (GTK_MENU_SHELL (pd->menu));
+
+ g_signal_handlers_disconnect_by_func (pd->menu,
+ context_menu_deactivate,
+ pd);
g_object_unref (pd->menu);
+ }
pd->menu = NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]