GNOME Bugzilla – Bug 728343
St: remove hover state if reactive disabled
Last modified: 2014-04-28 23:04:23 UTC
The hover state of a widget can become persistent if the widget becomes reactive while a pointer grab. To avoid that, remove hover state if the reactive property is disabled.
Created attachment 274457 [details] [review] St: remove hover state if reactive disabled
Review of attachment 274457 [details] [review]: ::: src/st/st-widget.c @@ +1449,3 @@ + // Remove hover state to avoid persistent hover state if + // the widget becomes not reactive while a pointer grab + st_widget_set_hover (widget, FALSE); I'd prefer updating sync_hover() to take reactivity into account and then call it here if track_hover is set. That way 1. calling sync_hover() will work as expected for non-reactive actors 2. the hover state will be correct after making an actor reactive
Created attachment 275262 [details] [review] St: remove hover state if reactive disabled The hover state of a widget can become persistent if the widget becomes reactive while a pointer grab. To avoid that, remove hover state if the reactive property is disabled.
Review of attachment 275262 [details] [review]: ::: src/st/st-widget.c @@ +1445,3 @@ st_widget_add_style_pseudo_class (widget, "insensitive"); + + st_widget_sync_hover(widget); When StWidget:track-hover is not set, we should not interfere with a manually set hover state.
(In reply to comment #4) > Review of attachment 275262 [details] [review]: > > ::: src/st/st-widget.c > @@ +1445,3 @@ > st_widget_add_style_pseudo_class (widget, "insensitive"); > + > + st_widget_sync_hover(widget); > > When StWidget:track-hover is not set, we should not interfere with a manually > set hover state. Right, you already said it before. Sorry, I forgot to add it.
Created attachment 275390 [details] [review] St: remove hover state if reactive disabled The hover state of a widget can become persistent if the widget becomes reactive while a pointer grab. To avoid that, remove hover state if the reactive property is disabled.
Review of attachment 275390 [details] [review]: Almost ... ::: src/st/st-widget.c @@ +1445,3 @@ st_widget_add_style_pseudo_class (widget, "insensitive"); + + if (st_widget_get_track_hover(widget)) Just access the struct member directly.
Created attachment 275391 [details] [review] St: remove hover state if reactive disabled The hover state of a widget can become persistent if the widget becomes reactive while a pointer grab. To avoid that, remove hover state if the reactive property is disabled.
(In reply to comment #7) > Review of attachment 275390 [details] [review]: > > Almost ... > > ::: src/st/st-widget.c > @@ +1445,3 @@ > st_widget_add_style_pseudo_class (widget, "insensitive"); > + > + if (st_widget_get_track_hover(widget)) > > Just access the struct member directly. Don't I need g_return_val_if_fail (ST_IS_WIDGET (widget), FALSE); then?
(In reply to comment #9) > Don't I need g_return_val_if_fail (ST_IS_WIDGET (widget), FALSE); then? No. That is input validation in a public function. You don't need this in an internal function where you know that the object type is correct.
Review of attachment 275391 [details] [review]: Yes.
Attachment 275391 [details] pushed as 103027a - St: remove hover state if reactive disabled