aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/launcher-menu-item.c16
-rw-r--r--src/launcher-menu-item.h1
2 files changed, 15 insertions, 2 deletions
diff --git a/src/launcher-menu-item.c b/src/launcher-menu-item.c
index 7970288..b869a40 100644
--- a/src/launcher-menu-item.c
+++ b/src/launcher-menu-item.c
@@ -48,7 +48,7 @@ static void launcher_menu_item_class_init (LauncherMenuItemClass *klass);
static void launcher_menu_item_init (LauncherMenuItem *self);
static void launcher_menu_item_dispose (GObject *object);
static void launcher_menu_item_finalize (GObject *object);
-void activate_cb (LauncherMenuItem * self, gpointer data);
+static void activate_cb (LauncherMenuItem * self, gpointer data);
G_DEFINE_TYPE (LauncherMenuItem, launcher_menu_item, DBUSMENU_TYPE_MENUITEM);
@@ -139,7 +139,9 @@ launcher_menu_item_get_name (LauncherMenuItem * appitem)
}
}
-void
+/* When the menu item is clicked on it tries to launch
+ the application that is represented by the desktop file */
+static void
activate_cb (LauncherMenuItem * self, gpointer data)
{
LauncherMenuItemPrivate * priv = LAUNCHER_MENU_ITEM_GET_PRIVATE(self);
@@ -153,3 +155,13 @@ activate_cb (LauncherMenuItem * self, gpointer data)
return;
}
+
+/* Hides the menu item based on whether it is eclipsed
+ or not. */
+void
+launcher_menu_item_set_eclipsed (LauncherMenuItem * li, gboolean eclipsed)
+{
+ g_debug("Laucher '%s' is %s", launcher_menu_item_get_name(li), eclipsed ? "now eclipsed" : "shown again");
+ dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(li), "show", eclipsed ? "false" : "true");
+ return;
+}
diff --git a/src/launcher-menu-item.h b/src/launcher-menu-item.h
index c351dd9..f17fbad 100644
--- a/src/launcher-menu-item.h
+++ b/src/launcher-menu-item.h
@@ -55,6 +55,7 @@ struct _LauncherMenuItem {
GType launcher_menu_item_get_type (void);
LauncherMenuItem * launcher_menu_item_new (const gchar * desktop_file);
const gchar * launcher_menu_item_get_name (LauncherMenuItem * appitem);
+void launcher_menu_item_set_eclipsed (LauncherMenuItem * li, gboolean eclipsed);
G_END_DECLS