Skip to content

Commit

Permalink
Merge pull request #1230 from FreeRDP/issue_1229
Browse files Browse the repository at this point in the history
Change Status Icon availability for gnome 3.16
  • Loading branch information
giox069 authored Jul 29, 2017
2 parents 0387ee0 + 6410c95 commit bac8222
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions remmina/src/remmina_icon.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ gboolean remmina_icon_is_available(void)

TRACE_CALL("remmina_icon_is_available");
gchar *gsversion;
unsigned int gsv_maj, gsv_min, gsv_seq;

if (!remmina_icon.icon)
return FALSE;
Expand All @@ -425,19 +426,31 @@ gboolean remmina_icon_is_available(void)
/* Special treatmen under Gnome Shell */
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);
#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 */
if (!remmina_sysinfo_is_appindicator_available())
if (remmina_sysinfo_is_appindicator_available())
{
/* 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
/* 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;
}
Expand Down

0 comments on commit bac8222

Please sign in to comment.