aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2022-10-04 04:26:58 +0200
committerRobert Tari <robert@tari.in>2022-10-04 04:26:58 +0200
commit3ae6943c22cf464dcc87e8055d637a6ca1b10e4f (patch)
treefcbceb7e6ef7832b9ff186d21f0c1ccf35acb799
parentd9ca6866aab3c4e8774e2dd8c9b9bcd865d9faac (diff)
downloadlibayatana-indicator-3ae6943c22cf464dcc87e8055d637a6ca1b10e4f.tar.gz
libayatana-indicator-3ae6943c22cf464dcc87e8055d637a6ca1b10e4f.tar.bz2
libayatana-indicator-3ae6943c22cf464dcc87e8055d637a6ca1b10e4f.zip
src/indicator-ng.c: Do not show tooltip on labels while the menu is open
-rw-r--r--src/indicator-ng.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/indicator-ng.c b/src/indicator-ng.c
index c3956cb..a94f57e 100644
--- a/src/indicator-ng.c
+++ b/src/indicator-ng.c
@@ -43,7 +43,7 @@ struct _IndicatorNg
gint position;
gchar *sTooltip;
guint name_watch_id;
-
+ gboolean bMenuShown;
GDBusConnection *session_bus;
GActionGroup *actions;
GMenuModel *menu;
@@ -440,6 +440,7 @@ static void indicator_ng_menu_shown(__attribute__((unused)) GtkWidget *pWidget,
{
IndicatorNg *self = pUserData;
guint nSectionCount = 0;
+ self->bMenuShown = TRUE;
indicator_ng_set_tooltip(self, NULL);
@@ -489,6 +490,7 @@ indicator_ng_menu_hidden (__attribute__((unused)) GtkWidget *widget,
gpointer user_data)
{
IndicatorNg *self = user_data;
+ self->bMenuShown = FALSE;
if (self->submenu_action)
g_action_group_change_action_state (self->actions, self->submenu_action,
@@ -621,7 +623,7 @@ indicator_ng_update_entry (IndicatorNg *self)
indicator_ng_set_label (self, label);
indicator_ng_set_icon_from_variant (self, icon);
indicator_ng_set_accessible_desc (self, accessible_desc);
- indicator_ng_set_tooltip (self, self->sTooltip);
+ indicator_ng_set_tooltip (self, self->bMenuShown ? NULL : self->sTooltip);
indicator_object_set_visible (INDICATOR_OBJECT (self), visible);
if (icon)
@@ -976,6 +978,7 @@ static void
indicator_ng_init (IndicatorNg *self)
{
self->sTooltip = NULL;
+ self->bMenuShown = FALSE;
m_pActionMuxer = g_quark_from_static_string ("gtk-widget-action-muxer");
for (guint nMenuSection = 0; nMenuSection < MENU_SECTIONS; nMenuSection++)