GNOME Bugzilla – Bug 753568
Optimize the GtkPopover transition
Last modified: 2015-08-16 02:04:57 UTC
Created attachment 309169 [details] [review] GtkPopover: Don't resize in the transition callback GtkPopover cals gtk_widget_queue_resize in its frameclock callback. I think it was even me who wrote it, but it turns out that just repainting it does not make any difference visually (I think? At least in my tests).
Review of attachment 309169 [details] [review]: ::: gtk/gtkpopover.c @@ +496,3 @@ gpointer user_data) { + GtkPopover *popover = (GtkPopover *) widget; Don't do this, always cast using the macro. You can make the macro expand to just the cast by compiling with G_DISABLE_CAST_CHECKS. @@ +519,3 @@ } + gtk_widget_queue_draw (widget); Why is that even necessary? What property are we changing that requires a redraw?
(In reply to Benjamin Otte (Company) from comment #1) > + gtk_widget_queue_draw (widget); > > Why is that even necessary? What property are we changing that requires a > redraw? Well we are using gtk_widget_set_opacity but that already queues a redraw (no idea if we can rely on that). We also set priv->transition_diff which is used in gtk_popover_update_position, which is e.g. use in the size_allocate handler and that's why I previously thought that a queue_resize would be necessary, but it either seems to happen anyway or it just doesn't make a difference. In any case, is there a way to make a GtkPopover resize not bubble up to its parent? I can't think of a case where the popover size would affect the toplevel size.