Commit bac8222a authored by Giovanni Panozzo's avatar Giovanni Panozzo Committed by GitHub

Merge pull request #1230 from FreeRDP/issue_1229

Change Status Icon availability for gnome 3.16
parents 0387ee0a 6410c95c
...@@ -416,6 +416,7 @@ gboolean remmina_icon_is_available(void) ...@@ -416,6 +416,7 @@ gboolean remmina_icon_is_available(void)
TRACE_CALL("remmina_icon_is_available"); TRACE_CALL("remmina_icon_is_available");
gchar *gsversion; gchar *gsversion;
unsigned int gsv_maj, gsv_min, gsv_seq;
if (!remmina_icon.icon) if (!remmina_icon.icon)
return FALSE; return FALSE;
...@@ -425,19 +426,31 @@ gboolean remmina_icon_is_available(void) ...@@ -425,19 +426,31 @@ gboolean remmina_icon_is_available(void)
/* Special treatmen under Gnome Shell */ /* Special treatmen under Gnome Shell */
if ((gsversion=remmina_sysinfo_get_gnome_shell_version()) != NULL) if ((gsversion=remmina_sysinfo_get_gnome_shell_version()) != NULL)
{ {
if (sscanf(gsversion, "%u.%u", &gsv_maj, &gsv_min) == 2)
gsv_seq = gsv_maj << 16 | gsv_min << 8;
else
gsv_seq = 0x030000;
g_free(gsversion); g_free(gsversion);
#ifdef HAVE_LIBAPPINDICATOR #ifdef HAVE_LIBAPPINDICATOR
/* Gnome Shell with compiled in LIBAPPINDICATOR: no systray icon, /* Gnome Shell with compiled in LIBAPPINDICATOR:
* ensure have also a working appindicator extension available */ * ensure have also a working appindicator extension available */
if (!remmina_sysinfo_is_appindicator_available()) if (remmina_sysinfo_is_appindicator_available())
{ {
/* No libappindicator extension for gnome shell, no remmina_icon */ /* No libappindicator extension for gnome shell, no remmina_icon */
return FALSE; return TRUE;
} }
#else
/* Gnome Shell without compiled in LIBAPPINDICATOR: no systray icon. */
return FALSE;
#endif #endif
/* Gnome Shell without LIBAPPINDICATOR */
if (gsv_seq >= 0x030A00) {
/* Gnome shell >= 3.16, Status Icon (GtkStatusIcon) is visible on the drawer
* at the bottom left of the screen */
return TRUE;
}
else {
/* Gnome shell < 3.16, Status Icon (GtkStatusIcon) is hidden
* on the message tray */
return FALSE;
}
} }
return TRUE; return TRUE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment