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.
This commit is contained in:
Carlos Garnacho 2014-02-20 16:24:59 +01:00
parent 8ea40e4956
commit eb0f86d485
4 changed files with 1 additions and 50 deletions

View File

@ -506,7 +506,6 @@ gtk_private_h_sources = \
gtkorientableprivate.h \
gtkpango.h \
gtkpathbar.h \
gtkpopoverprivate.h \
gtkpressandholdprivate.h \
gtkprintoperation-private.h \
gtkprintutils.h \

View File

@ -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)

View File

@ -1,26 +0,0 @@
/* GTK - The GIMP Toolkit
* Copyright © 2014 Carlos Garnacho <carlosg@gnome.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GTK_POPOVER_PRIVATE_H__
#define __GTK_POPOVER_PRIVATE_H__
#include "gtkpopover.h"
void _gtk_popover_set_apply_shape (GtkPopover *popover,
gboolean apply_shape);
#endif /* __GTK_POPOVER_PRIVATE_H__ */

View File

@ -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);