Fix coalescing of state animation areas for multiple window widgets.
Coordinates needed to be translated relative to the window position in within the widget.
This commit is contained in:
@ -34,6 +34,7 @@
|
|||||||
#include "gtkanimationdescription.h"
|
#include "gtkanimationdescription.h"
|
||||||
#include "gtktimeline.h"
|
#include "gtktimeline.h"
|
||||||
#include "gtkiconfactory.h"
|
#include "gtkiconfactory.h"
|
||||||
|
#include "gtkwidgetprivate.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:gtkstylecontext
|
* SECTION:gtkstylecontext
|
||||||
@ -2982,8 +2983,7 @@ _gtk_style_context_invalidate_animation_areas (GtkStyleContext *context)
|
|||||||
|
|
||||||
void
|
void
|
||||||
_gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
|
_gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
|
||||||
gint rel_x,
|
GtkWidget *widget)
|
||||||
gint rel_y)
|
|
||||||
{
|
{
|
||||||
GtkStyleContextPrivate *priv;
|
GtkStyleContextPrivate *priv;
|
||||||
GSList *l;
|
GSList *l;
|
||||||
@ -2998,6 +2998,7 @@ _gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
|
|||||||
while (l)
|
while (l)
|
||||||
{
|
{
|
||||||
AnimationInfo *info;
|
AnimationInfo *info;
|
||||||
|
gint rel_x, rel_y;
|
||||||
GSList *cur;
|
GSList *cur;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
@ -3017,6 +3018,7 @@ _gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
info->invalidation_region = cairo_region_create ();
|
info->invalidation_region = cairo_region_create ();
|
||||||
|
_gtk_widget_get_translation_to_window (widget, info->window, &rel_x, &rel_y);
|
||||||
|
|
||||||
for (i = 0; i < info->rectangles->len; i++)
|
for (i = 0; i < info->rectangles->len; i++)
|
||||||
{
|
{
|
||||||
|
@ -459,8 +459,7 @@ const GValue * _gtk_style_context_peek_style_property (GtkStyleContext *context,
|
|||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
void _gtk_style_context_invalidate_animation_areas (GtkStyleContext *context);
|
void _gtk_style_context_invalidate_animation_areas (GtkStyleContext *context);
|
||||||
void _gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
|
void _gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
|
||||||
gint rel_x,
|
GtkWidget *widget);
|
||||||
gint rel_y);
|
|
||||||
|
|
||||||
void gtk_style_context_invalidate (GtkStyleContext *context);
|
void gtk_style_context_invalidate (GtkStyleContext *context);
|
||||||
void gtk_style_context_reset_widgets (GdkScreen *screen);
|
void gtk_style_context_reset_widgets (GdkScreen *screen);
|
||||||
|
@ -5564,9 +5564,7 @@ _gtk_widget_draw_internal (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (widget);
|
context = gtk_widget_get_style_context (widget);
|
||||||
_gtk_style_context_coalesce_animation_areas (context,
|
_gtk_style_context_coalesce_animation_areas (context, widget);
|
||||||
widget->priv->allocation.x,
|
|
||||||
widget->priv->allocation.y);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -5688,11 +5686,11 @@ gtk_widget_event (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Returns TRUE if a translation should be done */
|
/* Returns TRUE if a translation should be done */
|
||||||
static gboolean
|
gboolean
|
||||||
gtk_widget_get_translation_to_window (GtkWidget *widget,
|
_gtk_widget_get_translation_to_window (GtkWidget *widget,
|
||||||
GdkWindow *window,
|
GdkWindow *window,
|
||||||
int *x,
|
int *x,
|
||||||
int *y)
|
int *y)
|
||||||
{
|
{
|
||||||
GdkWindow *w, *widget_window;
|
GdkWindow *w, *widget_window;
|
||||||
|
|
||||||
@ -5755,7 +5753,7 @@ gtk_cairo_transform_to_window (cairo_t *cr,
|
|||||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||||
|
|
||||||
if (gtk_widget_get_translation_to_window (widget, window, &x, &y))
|
if (_gtk_widget_get_translation_to_window (widget, window, &x, &y))
|
||||||
cairo_translate (cr, x, y);
|
cairo_translate (cr, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5798,9 +5796,9 @@ gtk_widget_send_expose (GtkWidget *widget,
|
|||||||
gdk_cairo_region (cr, event->expose.region);
|
gdk_cairo_region (cr, event->expose.region);
|
||||||
cairo_clip (cr);
|
cairo_clip (cr);
|
||||||
|
|
||||||
do_clip = gtk_widget_get_translation_to_window (widget,
|
do_clip = _gtk_widget_get_translation_to_window (widget,
|
||||||
event->expose.window,
|
event->expose.window,
|
||||||
&x, &y);
|
&x, &y);
|
||||||
cairo_translate (cr, -x, -y);
|
cairo_translate (cr, -x, -y);
|
||||||
|
|
||||||
_gtk_widget_draw_internal (widget, cr, do_clip);
|
_gtk_widget_draw_internal (widget, cr, do_clip);
|
||||||
|
@ -88,6 +88,11 @@ void _gtk_widget_restore_size_request (GtkWidget *widget,
|
|||||||
int old_width,
|
int old_width,
|
||||||
int old_height);
|
int old_height);
|
||||||
|
|
||||||
|
gboolean _gtk_widget_get_translation_to_window (GtkWidget *widget,
|
||||||
|
GdkWindow *window,
|
||||||
|
int *x,
|
||||||
|
int *y);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GTK_WIDGET_PRIVATE_H__ */
|
#endif /* __GTK_WIDGET_PRIVATE_H__ */
|
||||||
|
Reference in New Issue
Block a user