forked from AuroraMiddleware/gtk
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master Closes #3090 See merge request GNOME/gtk!2485
This commit is contained in:
commit
1e4c6cde10
@ -1627,8 +1627,10 @@ gdk_surface_constrain_size (GdkGeometry *geometry,
|
||||
* Obtains the current device position in doubles and modifier state.
|
||||
* The position is given in coordinates relative to the upper left
|
||||
* corner of @surface.
|
||||
*
|
||||
* Return: %TRUE if the device is over the surface
|
||||
**/
|
||||
void
|
||||
gboolean
|
||||
gdk_surface_get_device_position (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
double *x,
|
||||
@ -1637,17 +1639,20 @@ gdk_surface_get_device_position (GdkSurface *surface,
|
||||
{
|
||||
double tmp_x, tmp_y;
|
||||
GdkModifierType tmp_mask;
|
||||
gboolean ret;
|
||||
|
||||
g_return_if_fail (GDK_IS_SURFACE (surface));
|
||||
g_return_if_fail (GDK_IS_DEVICE (device));
|
||||
g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
|
||||
g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE);
|
||||
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, FALSE);
|
||||
|
||||
tmp_x = tmp_y = 0;
|
||||
tmp_x = 0;
|
||||
tmp_y = 0;
|
||||
tmp_mask = 0;
|
||||
GDK_SURFACE_GET_CLASS (surface)->get_device_state (surface,
|
||||
device,
|
||||
&tmp_x, &tmp_y,
|
||||
&tmp_mask);
|
||||
|
||||
ret = GDK_SURFACE_GET_CLASS (surface)->get_device_state (surface,
|
||||
device,
|
||||
&tmp_x, &tmp_y,
|
||||
&tmp_mask);
|
||||
|
||||
if (x)
|
||||
*x = tmp_x;
|
||||
@ -1655,6 +1660,8 @@ gdk_surface_get_device_position (GdkSurface *surface,
|
||||
*y = tmp_y;
|
||||
if (mask)
|
||||
*mask = tmp_mask;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -187,7 +187,7 @@ GDK_AVAILABLE_IN_ALL
|
||||
int gdk_surface_get_scale_factor (GdkSurface *surface);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_get_device_position (GdkSurface *surface,
|
||||
gboolean gdk_surface_get_device_position (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
double *x,
|
||||
double *y,
|
||||
|
@ -1335,9 +1335,9 @@ gtk_synthesize_crossing_events (GtkRoot *toplevel,
|
||||
|
||||
crossing.type = crossing_type;
|
||||
crossing.mode = mode;
|
||||
crossing.old_target = old_target;
|
||||
crossing.old_target = old_target ? g_object_ref (old_target) : NULL;
|
||||
crossing.old_descendent = NULL;
|
||||
crossing.new_target = new_target;
|
||||
crossing.new_target = new_target ? g_object_ref (new_target) : NULL;
|
||||
crossing.new_descendent = NULL;
|
||||
crossing.drop = drop;
|
||||
|
||||
@ -1417,6 +1417,9 @@ gtk_synthesize_crossing_events (GtkRoot *toplevel,
|
||||
gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_PRELIGHT, FALSE);
|
||||
}
|
||||
|
||||
g_clear_object (&crossing.old_target);
|
||||
g_clear_object (&crossing.new_target);
|
||||
|
||||
gtk_widget_stack_clear (&target_array);
|
||||
}
|
||||
|
||||
|
@ -4376,12 +4376,30 @@ gtk_widget_handle_crossing (GtkWidget *widget,
|
||||
|
||||
g_object_ref (widget);
|
||||
|
||||
if (crossing->old_target)
|
||||
g_object_ref (crossing->old_target);
|
||||
if (crossing->new_target)
|
||||
g_object_ref (crossing->new_target);
|
||||
if (crossing->old_descendent)
|
||||
g_object_ref (crossing->old_descendent);
|
||||
if (crossing->new_descendent)
|
||||
g_object_ref (crossing->new_descendent);
|
||||
|
||||
for (l = priv->event_controllers; l; l = l->next)
|
||||
{
|
||||
GtkEventController *controller = l->data;
|
||||
gtk_event_controller_handle_crossing (controller, crossing, x, y);
|
||||
}
|
||||
|
||||
if (crossing->old_target)
|
||||
g_object_unref (crossing->old_target);
|
||||
if (crossing->new_target)
|
||||
g_object_unref (crossing->new_target);
|
||||
if (crossing->old_descendent)
|
||||
g_object_unref (crossing->old_descendent);
|
||||
if (crossing->new_descendent)
|
||||
g_object_unref (crossing->new_descendent);
|
||||
|
||||
g_object_unref (widget);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user