forked from AuroraMiddleware/gtk
places sidebar: Stop using ::motion-notify-event
We can use the generic ::event signal here.
This commit is contained in:
parent
822f802aec
commit
f90659cde8
@ -1696,20 +1696,23 @@ stop_drop_feedback (GtkPlacesSidebar *sidebar)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
on_motion_notify_event (GtkWidget *widget,
|
sidebar_event_cb (GtkWidget *widget,
|
||||||
GdkEventMotion *event,
|
GdkEvent *event,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GtkPlacesSidebar *sidebar = GTK_PLACES_SIDEBAR (user_data);
|
GtkPlacesSidebar *sidebar = GTK_PLACES_SIDEBAR (user_data);
|
||||||
guint state;
|
guint state;
|
||||||
double x, y;
|
double x, y;
|
||||||
|
|
||||||
if (sidebar->drag_row == NULL || sidebar->dragging_over)
|
if (gdk_event_get_event_type (event) != GDK_MOTION_NOTIFY)
|
||||||
return FALSE;
|
return GDK_EVENT_PROPAGATE;
|
||||||
|
|
||||||
if (!gdk_event_get_state ((GdkEvent *) event, &state) ||
|
if (sidebar->drag_row == NULL || sidebar->dragging_over)
|
||||||
|
return GDK_EVENT_PROPAGATE;
|
||||||
|
|
||||||
|
if (!gdk_event_get_state (event, &state) ||
|
||||||
!(state & GDK_BUTTON1_MASK))
|
!(state & GDK_BUTTON1_MASK))
|
||||||
return FALSE;
|
return GDK_EVENT_PROPAGATE;
|
||||||
|
|
||||||
gdk_event_get_coords ((GdkEvent *) event, &x, &y);
|
gdk_event_get_coords ((GdkEvent *) event, &x, &y);
|
||||||
|
|
||||||
@ -1725,7 +1728,7 @@ on_motion_notify_event (GtkWidget *widget,
|
|||||||
sidebar->drag_x, sidebar->drag_y);
|
sidebar->drag_x, sidebar->drag_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return GDK_EVENT_PROPAGATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -4071,8 +4074,8 @@ gtk_places_sidebar_init (GtkPlacesSidebar *sidebar)
|
|||||||
sidebar->source_targets = gdk_content_formats_new (dnd_source_targets, G_N_ELEMENTS (dnd_source_targets));
|
sidebar->source_targets = gdk_content_formats_new (dnd_source_targets, G_N_ELEMENTS (dnd_source_targets));
|
||||||
sidebar->source_targets = gtk_content_formats_add_text_targets (sidebar->source_targets);
|
sidebar->source_targets = gtk_content_formats_add_text_targets (sidebar->source_targets);
|
||||||
|
|
||||||
g_signal_connect (sidebar->list_box, "motion-notify-event",
|
g_signal_connect (sidebar->list_box, "event",
|
||||||
G_CALLBACK (on_motion_notify_event), sidebar);
|
G_CALLBACK (sidebar_event_cb), sidebar);
|
||||||
g_signal_connect (sidebar->list_box, "drag-begin",
|
g_signal_connect (sidebar->list_box, "drag-begin",
|
||||||
G_CALLBACK (drag_begin_callback), sidebar);
|
G_CALLBACK (drag_begin_callback), sidebar);
|
||||||
g_signal_connect (sidebar->list_box, "drag-motion",
|
g_signal_connect (sidebar->list_box, "drag-motion",
|
||||||
|
Loading…
Reference in New Issue
Block a user