Skip to content
Snippets Groups Projects
Commit 805ec1d9 authored by Jonas Kümmerlin's avatar Jonas Kümmerlin Committed by Andre Miranda
Browse files

Sort of fix mouse gestures

They are still unreliable, but at least it doesn't print warnings anymore.
parent 81e645d8
No related branches found
No related tags found
No related merge requests found
...@@ -77,8 +77,8 @@ static gboolean thunar_abstract_icon_view_button_press_event (ExoIconView ...@@ -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, static gboolean thunar_abstract_icon_view_button_release_event (ExoIconView *view,
GdkEventButton *event, GdkEventButton *event,
ThunarAbstractIconView *abstract_icon_view); ThunarAbstractIconView *abstract_icon_view);
static gboolean thunar_abstract_icon_view_expose_event (ExoIconView *view, static gboolean thunar_abstract_icon_view_draw (ExoIconView *view,
GdkEventExpose *event, cairo_t *cr,
ThunarAbstractIconView *abstract_icon_view); ThunarAbstractIconView *abstract_icon_view);
static gboolean thunar_abstract_icon_view_key_press_event (ExoIconView *view, static gboolean thunar_abstract_icon_view_key_press_event (ExoIconView *view,
GdkEventKey *event, GdkEventKey *event,
...@@ -558,8 +558,8 @@ thunar_abstract_icon_view_button_press_event (ExoIconView *view, ...@@ -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_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_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", abstract_icon_view->priv->gesture_expose_id = g_signal_connect_after (G_OBJECT (view), "draw",
G_CALLBACK (thunar_abstract_icon_view_expose_event), G_CALLBACK (thunar_abstract_icon_view_draw),
G_OBJECT (abstract_icon_view)); G_OBJECT (abstract_icon_view));
abstract_icon_view->priv->gesture_motion_id = g_signal_connect (G_OBJECT (view), "motion-notify-event", 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), G_CALLBACK (thunar_abstract_icon_view_motion_notify_event),
...@@ -617,16 +617,15 @@ thunar_abstract_icon_view_button_release_event (ExoIconView *view, ...@@ -617,16 +617,15 @@ thunar_abstract_icon_view_button_release_event (ExoIconView *view,
static gboolean static gboolean
thunar_abstract_icon_view_expose_event (ExoIconView *view, thunar_abstract_icon_view_draw (ExoIconView *view,
GdkEventExpose *event, cairo_t *cr,
ThunarAbstractIconView *abstract_icon_view) ThunarAbstractIconView *abstract_icon_view)
{ {
GtkIconSet *stock_icon_set; GtkIconSet *stock_icon_set;
GtkAction *action = NULL; GtkAction *action = NULL;
GdkPixbuf *stock_icon = NULL; GdkPixbuf *stock_icon = NULL;
gchar *stock_id; gchar *stock_id;
GdkColor bg; GdkColor bg;
cairo_t *cr;
gint x, y; gint x, y;
_thunar_return_val_if_fail (EXO_IS_ICON_VIEW (view), FALSE); _thunar_return_val_if_fail (EXO_IS_ICON_VIEW (view), FALSE);
...@@ -635,9 +634,6 @@ thunar_abstract_icon_view_expose_event (ExoIconView *view, ...@@ -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_motion_id > 0, FALSE);
_thunar_return_val_if_fail (abstract_icon_view->priv->gesture_release_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 */ /* shade the abstract_icon view content while performing mouse gestures */
bg = gtk_widget_get_style (GTK_WIDGET (view))->base[GTK_STATE_NORMAL]; 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); 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, ...@@ -682,9 +678,6 @@ thunar_abstract_icon_view_expose_event (ExoIconView *view,
g_free (stock_id); g_free (stock_id);
} }
/* destroy context */
cairo_destroy (cr);
return FALSE; return FALSE;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment