GNOME Bugzilla – Bug 723556
Work around popover-over-clutter issues
Last modified: 2014-02-05 08:47:53 UTC
Until GTK+ learns how to render popovers with transparency on top of native subwindows, we can make the GtkVolumeButton appear less broken by making it non-transparent.
Created attachment 268001 [details] [review] Work around popover-over-clutter issues
Review of attachment 268001 [details] [review]: ::: src/backend/bacon-video-controls-actor.c @@ +120,3 @@ + "}"; + + volume_button = GTK_WIDGET (g_object_get_data (G_OBJECT (controls), "volume_button")); Nearly there, needs to get the actual popover with: gtk_scale_button_get_popup()
Created attachment 268034 [details] popup.png It removes the shadow, but we still have a problem with the pointy arrow.
Comment on attachment 268001 [details] [review] Work around popover-over-clutter issues I've committed a slight rework of this patch, to mitigate the problem. But we'll need GTK+ fixed before the release.
Created attachment 268051 [details] [review] demo: Temporary patch to show the popover-over-native bug
Created attachment 268052 [details] [review] popover: Apply child shapes on the GtkWidget popover subwindow This is just a hack to show that this work, it needs more work to handle unrealized window, realizing, reparenting, etc, etc. But it shows what the fix looks like.
Created attachment 268088 [details] [review] popover: Add private _gtk_popover_set_apply_shape() call Popovers no longer sets a shape, unless this function is called. This function exists so widgets that are potentially placed on top of other native windows can get a popover that's nicely shaped, even if it has no border shadow around.
Created attachment 268089 [details] [review] scalebutton: Apply a shape on the popover This hideous hack is necessary so far because the main users of GtkScaleButton are also clutter users, so the GtkScaleButton popover will be very likely shaped against a clutter-enabled native window.
(In reply to comment #6) > Created an attachment (id=268052) [details] [review] > popover: Apply child shapes on the GtkWidget popover subwindow > > This is just a hack to show that this work, it needs more work > to handle unrealized window, realizing, reparenting, etc, etc. > But it shows what the fix looks like. Actually looks ok to me, gtk_popover_update_position() should be called on the right situations already.
Created attachment 268090 [details] screenshot, how it looks with the last 3 patches
Review of attachment 268088 [details] [review]: ::: gtk/gtkpopover.c @@ +1739,3 @@ + priv = gtk_popover_get_instance_private (popover); + + if ((priv->apply_shape == TRUE) == (apply_shape == TRUE)) This looks pretty ugly to me - I personally hate nested == comparisons like that. I'd prefer this as apply_shape = apply_shape != FALSE; if (priv->apply_shape == apply_shape) return;
Comment on attachment 268088 [details] [review] popover: Add private _gtk_popover_set_apply_shape() call Finally this commit went with the ugly nested comparisons, sorry about that... I hope it all goes away soon though.
So all the pieces of this hack are now in GTK+. Better solutions are still being investigated, so this hopefully will go away soon after the release.
It's still a litle jagged, but it's much better than grey blobs around the arrow. Thanks!