[empathy/gnome-2-34] chat_window_contact_menu_update: unsensitive the menu if there is no submenu
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy/gnome-2-34] chat_window_contact_menu_update: unsensitive the menu if there is no submenu
- Date: Thu, 17 Mar 2011 14:25:48 +0000 (UTC)
commit ed2a37c2c6f41bb1f5704d2a2f748157fb054fc3
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Thu Mar 17 15:25:26 2011 +0100
chat_window_contact_menu_update: unsensitive the menu if there is no submenu
This is a manual backport from master.
src/empathy-chat-window.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 30a1f31..32339bd 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -405,11 +405,17 @@ chat_window_contact_menu_update (EmpathyChatWindowPriv *priv,
if (orig_submenu == NULL || !gtk_widget_get_visible (orig_submenu)) {
submenu = empathy_chat_get_contact_menu (priv->current_chat);
- /* gtk_menu_attach_to_widget () doesn't behave nicely here */
- g_object_set_data (G_OBJECT (submenu), "window", priv->dialog);
+ if (submenu != NULL) {
+ /* gtk_menu_attach_to_widget () doesn't behave nicely here */
+ g_object_set_data (G_OBJECT (submenu), "window", priv->dialog);
+
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), submenu);
+ gtk_widget_show (menu);
+ gtk_widget_set_sensitive (menu, TRUE);
+ } else {
+ gtk_widget_set_sensitive (menu, FALSE);
+ }
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu), submenu);
- gtk_widget_show (menu);
} else {
tp_g_signal_connect_object (orig_submenu,
"notify::visible",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]