st-bin: Delegate popup-menu signal to child if we have one

This makes it much easier to implement correct popup-menu behavior
in the case of nested bins.

This fixes the context menu key in application search results when a
result has focus.

https://bugzilla.gnome.org/show_bug.cgi?id=699800
This commit is contained in:
Jasper St. Pierre
2013-05-07 02:28:13 -04:00
parent eb80503bcc
commit 660b801775
3 changed files with 24 additions and 1 deletions

View File

@ -775,7 +775,7 @@ st_widget_key_press_event (ClutterActor *actor,
(event->keyval == CLUTTER_KEY_F10 &&
(event->modifier_state & CLUTTER_SHIFT_MASK)))
{
g_signal_emit (actor, signals[POPUP_MENU], 0);
st_widget_popup_menu (ST_WIDGET (actor));
return TRUE;
}
@ -1834,6 +1834,18 @@ st_widget_get_can_focus (StWidget *widget)
return widget->priv->can_focus;
}
/**
* st_widget_popup_menu:
* @self: A #StWidget
*
* Asks the widget to pop-up a context menu.
*/
void
st_widget_popup_menu (StWidget *self)
{
g_signal_emit (self, signals[POPUP_MENU], 0);
}
/* filter @children to contain only only actors that overlap @rbox
* when moving in @direction. (Assuming no transformations.)
*/