summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2014-01-15 00:30:12 -0500
committerRyan Lortie <desrt@desrt.ca>2014-01-17 22:37:04 -0500
commitceeef03004468a03ff9816493ca2f3a7fee287d9 (patch)
treed7cb0cedac89cd24515bf91827a8a4de2a3250ea
parenta4d69e7f14ef56d8ad6af79c8e6bc2f7eb984f33 (diff)
downloadgtk+-ceeef03004468a03ff9816493ca2f3a7fee287d9.tar.gz
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
-rw-r--r--gtk/gtkapplication-quartz-menu.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/gtk/gtkapplication-quartz-menu.c b/gtk/gtkapplication-quartz-menu.c
index 0282996aaf..60e13d0286 100644
--- a/gtk/gtkapplication-quartz-menu.c
+++ b/gtk/gtkapplication-quartz-menu.c
@@ -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);