quartz menu: add special items

Add support for the "Hide app", "Hide Others" and "Show All" special
items and for the "Services" submenu.

https://bugzilla.gnome.org/show_bug.cgi?id=720552
This commit is contained in:
Ryan Lortie 2014-01-15 00:30:12 -05:00
parent a4d69e7f14
commit ceeef03004

View File

@ -139,7 +139,31 @@ icon_loaded (GObject *object,
if (self != nil)
{
[self setTarget:self];
const gchar *special = gtk_menu_tracker_item_get_special (aTrackerItem);
if (special && g_str_equal (special, "hide-this"))
{
[self setAction:@selector(hide:)];
[self setTarget:NSApp];
}
else if (special && g_str_equal (special, "hide-others"))
{
[self setAction:@selector(hideOtherApplications:)];
[self setTarget:NSApp];
}
else if (special && g_str_equal (special, "show-all"))
{
[self setAction:@selector(unhideAllApplications:)];
[self setTarget:NSApp];
}
else if (special && g_str_equal (special, "services-submenu"))
{
[self setSubmenu:[[[NSMenu alloc] init] autorelease]];
[NSApp setServicesMenu:[self submenu]];
[self setTarget:self];
}
else
[self setTarget:self];
trackerItem = g_object_ref (aTrackerItem);
trackerItemChangedHandler = g_signal_connect (trackerItem, "notify", G_CALLBACK (tracker_item_changed), self);