diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index 3e1f21034..f59dccb87 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -23,7 +23,8 @@ function SearchEntry(focusBase) { SearchEntry.prototype = { _init : function(focusBase) { this.actor = new St.Entry({ name: 'searchEntry', - hint_text: _("Search your computer") }); + hint_text: _("Search your computer"), + track_hover: true }); this.entry = this.actor.clutter_text; this.actor.clutter_text.connect('text-changed', Lang.bind(this, @@ -73,13 +74,7 @@ SearchEntry.prototype = { }, reset: function () { - let [x, y, mask] = global.get_pointer(); - let actor = global.stage.get_actor_at_pos (Clutter.PickMode.REACTIVE, - x, y); - // this.actor is never hovered directly, only its clutter_text and icon - let hovered = this.actor == actor.get_parent(); - - this.actor.set_hover(hovered); + this.actor.sync_hover(); this.entry.text = ''; diff --git a/src/st/st-entry.c b/src/st/st-entry.c index fe0fe34bb..0cded5a49 100644 --- a/src/st/st-entry.c +++ b/src/st/st-entry.c @@ -599,31 +599,6 @@ st_entry_key_focus_in (ClutterActor *actor) clutter_actor_grab_key_focus (priv->entry); } -static gboolean -st_entry_enter_event (ClutterActor *actor, - ClutterCrossingEvent *event) -{ - StEntryPrivate *priv = ST_ENTRY_PRIV (actor); - - if (clutter_actor_contains (actor, event->source) - && priv->hint && priv->hint_visible) - { - st_widget_set_hover (ST_WIDGET (actor), TRUE); - } - - return CLUTTER_ACTOR_CLASS (st_entry_parent_class)->enter_event (actor, event); -} - -static gboolean -st_entry_leave_event (ClutterActor *actor, - ClutterCrossingEvent *event) -{ - if (!clutter_actor_contains (actor, event->related)) - st_widget_set_hover (ST_WIDGET (actor), FALSE); - - return CLUTTER_ACTOR_CLASS (st_entry_parent_class)->leave_event (actor, event); -} - static void st_entry_class_init (StEntryClass *klass) { @@ -649,8 +624,6 @@ st_entry_class_init (StEntryClass *klass) actor_class->key_press_event = st_entry_key_press_event; actor_class->key_focus_in = st_entry_key_focus_in; - actor_class->enter_event = st_entry_enter_event; - actor_class->leave_event = st_entry_leave_event; widget_class->style_changed = st_entry_style_changed; widget_class->navigate_focus = st_entry_navigate_focus;