forked from AuroraMiddleware/gtk
Stop using gtk_get_event_target
This is just a thin wrapper around gdk_event_get_target, so use that directly.
This commit is contained in:
parent
dd251d85c4
commit
1b2289ad9b
@ -853,7 +853,7 @@ scrolled_window_drag_begin_cb (GtkScrolledWindow *scrolled_window,
|
||||
gtk_scrolled_window_cancel_deceleration (scrolled_window);
|
||||
sequence = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
|
||||
event = gtk_gesture_get_last_event (gesture, sequence);
|
||||
event_widget = gtk_get_event_target ((GdkEvent *) event);
|
||||
event_widget = GTK_WIDGET (gdk_event_get_target (event));
|
||||
|
||||
if (event_widget == priv->vscrollbar || event_widget == priv->hscrollbar ||
|
||||
(!may_hscroll (scrolled_window) && !may_vscroll (scrolled_window)))
|
||||
@ -1183,6 +1183,7 @@ captured_motion (GtkScrolledWindow *sw,
|
||||
GdkInputSource input_source;
|
||||
GdkModifierType state;
|
||||
GdkEvent *event;
|
||||
GtkWidget *target;
|
||||
|
||||
if (!priv->use_indicators)
|
||||
return;
|
||||
@ -1198,7 +1199,11 @@ captured_motion (GtkScrolledWindow *sw,
|
||||
|
||||
gdk_event_get_state (event, &state);
|
||||
|
||||
if (!gtk_get_event_target_with_type (event, GTK_TYPE_SCROLLBAR) &&
|
||||
target = GTK_WIDGET (gdk_event_get_target (event));
|
||||
while (target && !GTK_IS_SCROLLBAR (target))
|
||||
target = gtk_widget_get_parent (target);
|
||||
|
||||
if (!target &&
|
||||
(state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)) != 0)
|
||||
{
|
||||
indicator_set_over (&priv->hindicator, FALSE);
|
||||
@ -1213,10 +1218,6 @@ captured_motion (GtkScrolledWindow *sw,
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkWidget *target;
|
||||
|
||||
target = gtk_get_event_target_with_type (event, GTK_TYPE_SCROLLBAR);
|
||||
|
||||
if (!check_update_scrollbar_proximity (sw, &priv->vindicator, target, x, y))
|
||||
check_update_scrollbar_proximity (sw, &priv->hindicator, target, x, y);
|
||||
else
|
||||
|
@ -2069,7 +2069,7 @@ _gtk_widget_emulate_press (GtkWidget *widget,
|
||||
gdouble x, y;
|
||||
graphene_point_t p;
|
||||
|
||||
event_widget = gtk_get_event_target ((GdkEvent *) event);
|
||||
event_widget = GTK_WIDGET (gdk_event_get_target (event));
|
||||
|
||||
if (event_widget == widget)
|
||||
return;
|
||||
@ -4966,7 +4966,7 @@ gtk_widget_event_internal (GtkWidget *widget,
|
||||
x = y = 0;
|
||||
translate_event_coordinates (event, &x, &y, widget);
|
||||
|
||||
if (widget == gtk_get_event_target (event))
|
||||
if (widget == GTK_WIDGET (gdk_event_get_target (event)))
|
||||
return_val |= gtk_widget_run_controllers (widget, event, x, y, GTK_PHASE_TARGET);
|
||||
|
||||
if (return_val == FALSE)
|
||||
@ -11939,7 +11939,7 @@ gtk_widget_cancel_event_sequence (GtkWidget *widget,
|
||||
if (!event)
|
||||
return;
|
||||
|
||||
event_widget = gtk_get_event_target ((GdkEvent *) event);
|
||||
event_widget = GTK_WIDGET (gdk_event_get_target (event));
|
||||
|
||||
while (event_widget)
|
||||
{
|
||||
|
@ -1509,7 +1509,7 @@ drag_gesture_update_cb (GtkGestureDrag *gesture,
|
||||
if (gtk_event_controller_get_propagation_phase (GTK_EVENT_CONTROLLER (gesture)) == GTK_PHASE_CAPTURE)
|
||||
{
|
||||
const GdkEvent *event = gtk_gesture_get_last_event (GTK_GESTURE (gesture), sequence);
|
||||
GtkWidget *event_widget = gtk_get_event_target (event);
|
||||
GtkWidget *event_widget = GTK_WIDGET (gdk_event_get_target (event));
|
||||
|
||||
/* Check whether the target widget should be left alone at handling
|
||||
* the sequence, this is better done late to give room for gestures
|
||||
|
Loading…
Reference in New Issue
Block a user