forked from AuroraMiddleware/gtk
gtkwidget: Drop _gtk_widget_get_device_surface()
A widget cannot have multiple surfaces anymore, nor needs to fetch the last event surface as it ought to handle its own.
This commit is contained in:
parent
f872eb64b5
commit
42ed8a2748
@ -1887,12 +1887,12 @@ synth_crossing_for_grab_notify (GtkWidget *from,
|
||||
if (!from)
|
||||
from_surface = NULL;
|
||||
else
|
||||
from_surface = _gtk_widget_get_device_surface (from, device);
|
||||
from_surface = gtk_native_get_surface (gtk_widget_get_native (from));
|
||||
|
||||
if (!to)
|
||||
to_surface = NULL;
|
||||
else
|
||||
to_surface = _gtk_widget_get_device_surface (to, device);
|
||||
to_surface = gtk_native_get_surface (gtk_widget_get_native (to));
|
||||
|
||||
if (from_surface || to_surface)
|
||||
{
|
||||
|
@ -7558,32 +7558,6 @@ is_my_surface (GtkWidget *widget,
|
||||
return gdk_surface_get_widget (surface) == widget;
|
||||
}
|
||||
|
||||
/*
|
||||
* _gtk_widget_get_device_surface:
|
||||
* @widget: a #GtkWidget
|
||||
* @device: a #GdkDevice
|
||||
*
|
||||
* Returns: (nullable): the surface of @widget that @device is in, or %NULL
|
||||
*/
|
||||
GdkSurface *
|
||||
_gtk_widget_get_device_surface (GtkWidget *widget,
|
||||
GdkDevice *device)
|
||||
{
|
||||
GdkSurface *surface;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
|
||||
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
|
||||
|
||||
if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
|
||||
return NULL;
|
||||
|
||||
surface = gdk_device_get_last_event_surface (device);
|
||||
if (surface && is_my_surface (widget, surface))
|
||||
return surface;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* _gtk_widget_list_devices:
|
||||
* @widget: a #GtkWidget
|
||||
@ -7666,19 +7640,14 @@ _gtk_widget_synthesize_crossing (GtkWidget *from,
|
||||
{
|
||||
crossing.direction = GTK_CROSSING_OUT;
|
||||
|
||||
from_surface = _gtk_widget_get_device_surface (from, device);
|
||||
if (!from_surface)
|
||||
from_surface = gtk_widget_get_surface (from);
|
||||
|
||||
from_surface = gtk_widget_get_surface (from);
|
||||
gdk_surface_get_device_position (from_surface, device, &x, &y, NULL);
|
||||
gtk_widget_handle_crossing (from, &crossing, x, y);
|
||||
}
|
||||
|
||||
if (to)
|
||||
{
|
||||
to_surface = _gtk_widget_get_device_surface (to, device);
|
||||
if (!to_surface)
|
||||
to_surface = gtk_widget_get_surface (to);
|
||||
to_surface = gtk_widget_get_surface (to);
|
||||
|
||||
crossing.direction = GTK_CROSSING_IN;
|
||||
gdk_surface_get_device_position (to_surface, device, &x, &y, NULL);
|
||||
|
@ -257,8 +257,6 @@ void _gtk_widget_propagate_display_changed (GtkWidget *widget,
|
||||
void _gtk_widget_set_device_surface (GtkWidget *widget,
|
||||
GdkDevice *device,
|
||||
GdkSurface *pointer_window);
|
||||
GdkSurface * _gtk_widget_get_device_surface (GtkWidget *widget,
|
||||
GdkDevice *device);
|
||||
GdkDevice ** _gtk_widget_list_devices (GtkWidget *widget,
|
||||
guint *out_n_devices);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user