[gtk+] popover: Always apply the window shape



commit eb0f86d485b0326f9e1ac7c8bf8093d71da6c92d
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Feb 20 16:24:59 2014 +0100

    popover: Always apply the window shape
    
    In practice this shape is only used to outline the popover when it is
    above native windows, in the most normal full-csw case the shape won't apply
    visibly, so popovers will still be able to cast a shadow there.
    
    If there are native windows below the popover, the shape will exclude the
    shadow, so there are no alpha contents above the window. One worst case that
    might happen is that the popover lays above patches of native/client-side
    windows, so the shadow could come and go around the border. But first let's
    see whether that happens often or visibly enough before adding something more
    convoluted.

 gtk/Makefile.am         |    1 -
 gtk/gtkpopover.c        |   20 +-------------------
 gtk/gtkpopoverprivate.h |   26 --------------------------
 gtk/gtkscalebutton.c    |    4 ----
 4 files changed, 1 insertions(+), 50 deletions(-)
---
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index d5ba0bd..6df2a89 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -506,7 +506,6 @@ gtk_private_h_sources =             \
        gtkorientableprivate.h  \
        gtkpango.h              \
        gtkpathbar.h            \
-       gtkpopoverprivate.h     \
        gtkpressandholdprivate.h \
        gtkprintoperation-private.h \
        gtkprintutils.h         \
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 8415df1..a309bbf 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -44,7 +44,6 @@
 #include <gdk/gdk.h>
 #include <cairo-gobject.h>
 #include "gtkpopover.h"
-#include "gtkpopoverprivate.h"
 #include "gtktypebuiltins.h"
 #include "gtkmain.h"
 #include "gtkwindowprivate.h"
@@ -123,6 +122,7 @@ gtk_popover_init (GtkPopover *popover)
   gtk_widget_set_has_window (widget, TRUE);
   popover->priv = gtk_popover_get_instance_private (popover);
   popover->priv->modal = TRUE;
+  popover->priv->apply_shape = TRUE;
 }
 
 static void
@@ -1815,24 +1815,6 @@ gtk_popover_get_modal (GtkPopover *popover)
   return popover->priv->modal;
 }
 
-void
-_gtk_popover_set_apply_shape (GtkPopover *popover,
-                              gboolean    apply_shape)
-{
-  GtkPopoverPrivate *priv = popover->priv;
-
-  g_return_if_fail (GTK_IS_POPOVER (popover));
-
-  apply_shape = apply_shape != FALSE;
-
-  if (priv->apply_shape == apply_shape)
-    return;
-
-  priv->apply_shape = apply_shape;
-  gtk_popover_update_position (popover);
-  gtk_widget_queue_draw (GTK_WIDGET (popover));
-}
-
 static void
 gtk_popover_tracker_remove_func (gint     position,
                                  gpointer user_data)
diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c
index 4ef8a45..29dee83 100644
--- a/gtk/gtkscalebutton.c
+++ b/gtk/gtkscalebutton.c
@@ -57,7 +57,6 @@
 #include "gtktypebuiltins.h"
 #include "gtkintl.h"
 #include "a11y/gtkscalebuttonaccessible.h"
-#include "gtkpopoverprivate.h"
 
 /**
  * SECTION:gtkscalebutton
@@ -357,9 +356,6 @@ gtk_scale_button_init (GtkScaleButton *button)
   gtk_widget_init_template (GTK_WIDGET (button));
   gtk_popover_set_relative_to (GTK_POPOVER (priv->dock), GTK_WIDGET (button));
 
-  /* FIXME: to be removed when compositing over native windows is fixed */
-  _gtk_popover_set_apply_shape (GTK_POPOVER (priv->dock), TRUE);
-
   /* Need a local reference to the adjustment */
   g_object_ref (priv->adjustment);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]