Commit 092586c9 authored by Tanner Doshier's avatar Tanner Doshier Committed by Jasper St. Pierre
Browse files

focus-manager: Add navigate_from_event method

This will be used to implement key navigation inside the calendar without
having to listen to key events manually.
parent 31478e9f
......@@ -233,3 +233,26 @@ st_focus_manager_get_group (StFocusManager *manager,
return ST_WIDGET (actor);
* st_focus_manager_navigate_from_event:
* @manager: the #StFocusManager
* @event: a #ClutterEvent
* Try to navigate from @event as if it bubbled all the way up to
* the stage. This is useful in complex event handling situations
* where you want key navigation, but a parent might be stopping
* the key navigation event from bubbling all the way up to the stage.
* Returns: Whether a new actor was navigated to
st_focus_manager_navigate_from_event (StFocusManager *manager,
ClutterEvent *event)
if (event->type != CLUTTER_KEY_PRESS)
return FALSE;
ClutterActor *stage = CLUTTER_ACTOR (event->key.stage);
return st_focus_manager_stage_event (stage, event, manager);
......@@ -75,6 +75,8 @@ void st_focus_manager_remove_group (StFocusManager *manager,
StWidget *root);
StWidget *st_focus_manager_get_group (StFocusManager *manager,
StWidget *widget);
gboolean st_focus_manager_navigate_from_event (StFocusManager *manager,
ClutterEvent *event);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment