popupMenu, panelMenu: split up panel and non-panel keynav

PopupMenuManager was pretending that it knew nothing about the menu's
sourceActors, while also trying to handle keynav between them. This
was a big mess, and resulted in bugs in navigation between panel menus
and the Activities button, and it totally gets in the way when trying
to add keynav to the dash (whose menu sources are arranged vertically
rather than horizontally).

Fix this up by moving the panel-specific parts to PanelMenuButton
instead.

https://bugzilla.gnome.org/show_bug.cgi?id=641253
This commit is contained in:
Dan Winship
2011-02-08 14:53:43 -05:00
parent df848fdb4d
commit ef6cce8988
4 changed files with 103 additions and 122 deletions

View File

@ -199,3 +199,26 @@ st_focus_manager_remove_group (StFocusManager *manager,
{
g_hash_table_remove (manager->priv->groups, root);
}
/**
* st_focus_manager_get_group:
* @manager: the #StFocusManager
* @widget: an #StWidget
*
* Checks if @widget is inside a focus group, and if so, returns
* the root of that group.
*
* Return value: (transfer none): the focus group root, or %NULL if
* @widget is not in a focus group
*/
StWidget *
st_focus_manager_get_group (StFocusManager *manager,
StWidget *widget)
{
ClutterActor *actor = CLUTTER_ACTOR (widget);
while (actor && !g_hash_table_lookup (manager->priv->groups, actor))
actor = clutter_actor_get_parent (actor);
return ST_WIDGET (actor);
}

View File

@ -73,6 +73,8 @@ void st_focus_manager_add_group (StFocusManager *manager,
StWidget *root);
void st_focus_manager_remove_group (StFocusManager *manager,
StWidget *root);
StWidget *st_focus_manager_get_group (StFocusManager *manager,
StWidget *widget);
G_END_DECLS