Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Status Icon availability for gnome 3.16 #1230

Merged
merged 1 commit into from
Jul 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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