[Xfce4-commits] [xfce/thunar] 12/46: Sort of fix mouse gestures
noreply at xfce.org
noreply at xfce.org
Tue Aug 15 02:35:20 CEST 2017
This is an automated email from the git hooks/post-receive script.
a n d r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/thunar.
commit 805ec1d9ea2a4fffb65e3924497a21c0fd890306
Author: Jonas Kümmerlin <rgcjonas at gmail.com>
Date: Sat Aug 8 18:27:28 2015 +0200
Sort of fix mouse gestures
They are still unreliable, but at least it doesn't print warnings anymore.
---
thunar/thunar-abstract-icon-view.c | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/thunar/thunar-abstract-icon-view.c b/thunar/thunar-abstract-icon-view.c
index 15c83d6..ee565a8 100644
--- a/thunar/thunar-abstract-icon-view.c
+++ b/thunar/thunar-abstract-icon-view.c
@@ -77,8 +77,8 @@ static gboolean thunar_abstract_icon_view_button_press_event (ExoIconView
static gboolean thunar_abstract_icon_view_button_release_event (ExoIconView *view,
GdkEventButton *event,
ThunarAbstractIconView *abstract_icon_view);
-static gboolean thunar_abstract_icon_view_expose_event (ExoIconView *view,
- GdkEventExpose *event,
+static gboolean thunar_abstract_icon_view_draw (ExoIconView *view,
+ cairo_t *cr,
ThunarAbstractIconView *abstract_icon_view);
static gboolean thunar_abstract_icon_view_key_press_event (ExoIconView *view,
GdkEventKey *event,
@@ -558,8 +558,8 @@ thunar_abstract_icon_view_button_press_event (ExoIconView *view,
{
abstract_icon_view->priv->gesture_start_x = abstract_icon_view->priv->gesture_current_x = event->x;
abstract_icon_view->priv->gesture_start_y = abstract_icon_view->priv->gesture_current_y = event->y;
- abstract_icon_view->priv->gesture_expose_id = g_signal_connect_after (G_OBJECT (view), "expose-event",
- G_CALLBACK (thunar_abstract_icon_view_expose_event),
+ abstract_icon_view->priv->gesture_expose_id = g_signal_connect_after (G_OBJECT (view), "draw",
+ G_CALLBACK (thunar_abstract_icon_view_draw),
G_OBJECT (abstract_icon_view));
abstract_icon_view->priv->gesture_motion_id = g_signal_connect (G_OBJECT (view), "motion-notify-event",
G_CALLBACK (thunar_abstract_icon_view_motion_notify_event),
@@ -617,16 +617,15 @@ thunar_abstract_icon_view_button_release_event (ExoIconView *view,
static gboolean
-thunar_abstract_icon_view_expose_event (ExoIconView *view,
- GdkEventExpose *event,
- ThunarAbstractIconView *abstract_icon_view)
+thunar_abstract_icon_view_draw (ExoIconView *view,
+ cairo_t *cr,
+ ThunarAbstractIconView *abstract_icon_view)
{
GtkIconSet *stock_icon_set;
GtkAction *action = NULL;
GdkPixbuf *stock_icon = NULL;
gchar *stock_id;
GdkColor bg;
- cairo_t *cr;
gint x, y;
_thunar_return_val_if_fail (EXO_IS_ICON_VIEW (view), FALSE);
@@ -635,9 +634,6 @@ thunar_abstract_icon_view_expose_event (ExoIconView *view,
_thunar_return_val_if_fail (abstract_icon_view->priv->gesture_motion_id > 0, FALSE);
_thunar_return_val_if_fail (abstract_icon_view->priv->gesture_release_id > 0, FALSE);
- /* create the cairo context (is already clipped) */
- cr = gdk_cairo_create (event->window);
-
/* shade the abstract_icon view content while performing mouse gestures */
bg = gtk_widget_get_style (GTK_WIDGET (view))->base[GTK_STATE_NORMAL];
cairo_set_source_rgba (cr, bg.red / 65535.0, bg.green / 65535.0, bg.blue / 65535.0, 0.7);
@@ -682,9 +678,6 @@ thunar_abstract_icon_view_expose_event (ExoIconView *view,
g_free (stock_id);
}
- /* destroy context */
- cairo_destroy (cr);
-
return FALSE;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list