After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 723556 - Work around popover-over-clutter issues
Work around popover-over-clutter issues
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-02-03 20:54 UTC by Matthias Clasen
Modified: 2014-02-05 08:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Work around popover-over-clutter issues (1.61 KB, patch)
2014-02-03 20:54 UTC, Matthias Clasen
reviewed Details | Review
popup.png (2.76 KB, image/png)
2014-02-04 07:47 UTC, Bastien Nocera
  Details
demo: Temporary patch to show the popover-over-native bug (1.42 KB, patch)
2014-02-04 11:09 UTC, Alexander Larsson
none Details | Review
popover: Apply child shapes on the GtkWidget popover subwindow (923 bytes, patch)
2014-02-04 11:09 UTC, Alexander Larsson
committed Details | Review
popover: Add private _gtk_popover_set_apply_shape() call (7.09 KB, patch)
2014-02-04 19:49 UTC, Carlos Garnacho
committed Details | Review
scalebutton: Apply a shape on the popover (1.19 KB, patch)
2014-02-04 19:49 UTC, Carlos Garnacho
committed Details | Review
screenshot, how it looks with the last 3 patches (19.72 KB, image/png)
2014-02-04 19:53 UTC, Carlos Garnacho
  Details

Description Matthias Clasen 2014-02-03 20:54:09 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.
Comment 1 Matthias Clasen 2014-02-03 20:54:11 UTC
Created attachment 268001 [details] [review]
Work around popover-over-clutter issues
Comment 2 Bastien Nocera 2014-02-04 07:46:52 UTC
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()
Comment 3 Bastien Nocera 2014-02-04 07:47:55 UTC
Created attachment 268034 [details]
popup.png

It removes the shadow, but we still have a problem with the pointy arrow.
Comment 4 Bastien Nocera 2014-02-04 07:55:12 UTC
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.
Comment 5 Alexander Larsson 2014-02-04 11:09:08 UTC
Created attachment 268051 [details] [review]
demo: Temporary patch to show the popover-over-native bug
Comment 6 Alexander Larsson 2014-02-04 11:09:20 UTC
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.
Comment 7 Carlos Garnacho 2014-02-04 19:49:35 UTC
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.
Comment 8 Carlos Garnacho 2014-02-04 19:49:39 UTC
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.
Comment 9 Carlos Garnacho 2014-02-04 19:51:22 UTC
(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.
Comment 10 Carlos Garnacho 2014-02-04 19:53:00 UTC
Created attachment 268090 [details]
screenshot, how it looks with the last 3 patches
Comment 11 Matthias Clasen 2014-02-04 20:16:40 UTC
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 12 Carlos Garnacho 2014-02-04 21:32:12 UTC
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.
Comment 13 Carlos Garnacho 2014-02-04 22:06:27 UTC
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.
Comment 14 Bastien Nocera 2014-02-05 08:47:53 UTC
It's still a litle jagged, but it's much better than grey blobs around the arrow. Thanks!