aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README4
-rw-r--r--TODO2
-rw-r--r--src/service.c11
3 files changed, 14 insertions, 3 deletions
diff --git a/README b/README
index 420541e..29a135f 100644
--- a/README
+++ b/README
@@ -12,7 +12,7 @@ As per the https://wiki.ubuntu.com/SystemMenu specification, both need four
visual components: (1) an Active Session Mark, the user's (2) icon, (3) name,
and (4) a Logged In Mark.
-== User menuitems can be recognized by their "indicator.switch-to-user" action.
+== User menuitems have "x-canonical-type" set to "indicator.user-menu-item"
Their four visual components are determined by:
1. You can test for the Action Session Mark by checking the action's state.
@@ -30,7 +30,7 @@ and (4) a Logged In Mark.
an array of usernames. If the array contains the username in this
menuitem's "target" attribute, show the Logged In Mark.
-== The Guest switcher can be recognized by its "indicator.switch-to-guest"
+== The Guest switcher has "x-canonical-type" set to "indicator.guest-menu-item"
action. Its four visual components are determined by:
1. You can test for the Active Session Mark by checking the action's state.
diff --git a/TODO b/TODO
index a9feedc..f47802a 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,6 @@
code
+ x x-canonical-type for user/guest menuitems
+ x remove the --replace command-line argument
- fix deprecated/dead APIs use in backend
cmake
diff --git a/src/service.c b/src/service.c
index 83bfeaa..4a62bd1 100644
--- a/src/service.c
+++ b/src/service.c
@@ -465,7 +465,15 @@ create_switch_section (IndicatorSessionService * self)
g_object_unref (item);
if (indicator_session_guest_is_allowed (p->backend_guest))
- g_menu_append (menu, _("Guest Session"), "indicator.switch-to-guest");
+ {
+ GMenuItem *item;
+
+ item = g_menu_item_new (_("Guest Session"), "indicator.switch-to-guest");
+ g_menu_item_set_attribute (item, "x-canonical-type", "s", "indicator.guest-menu-item");
+ g_menu_append_item (menu, item);
+
+ g_object_unref (item);
+ }
/* build an array of all the users we know of */
users = g_ptr_array_new ();
@@ -489,6 +497,7 @@ create_switch_section (IndicatorSessionService * self)
const IndicatorSessionUser * u = g_ptr_array_index (users, i);
item = g_menu_item_new (u->real_name, NULL);
g_menu_item_set_action_and_target (item, "indicator.switch-to-user", "s", u->user_name);
+ g_menu_item_set_attribute (item, "x-canonical-type", "s", "indicator.user-menu-item");
g_menu_append_item (menu, item);
g_object_unref (item);
}