widget: Connect to GdkSurface::event

This lets us handle input events the same way
we do expose events.
This commit is contained in:
Matthias Clasen 2019-02-23 13:49:28 -05:00
parent 23fb77af43
commit d633beaccd

View File

@ -11426,6 +11426,16 @@ surface_expose (GdkSurface *surface,
return TRUE;
}
static gboolean
surface_event (GdkSurface *surface,
GdkEvent *event,
GtkWidget *widget)
{
gtk_main_do_event (event);
return TRUE;
}
/**
* gtk_widget_register_surface:
* @widget: a #GtkWidget
@ -11455,6 +11465,7 @@ gtk_widget_register_surface (GtkWidget *widget,
gdk_surface_set_user_data (surface, widget);
g_signal_connect (surface, "render", G_CALLBACK (surface_expose), widget);
g_signal_connect (surface, "event", G_CALLBACK (surface_event), widget);
}
/**
@ -11480,6 +11491,7 @@ gtk_widget_unregister_surface (GtkWidget *widget,
gdk_surface_set_user_data (surface, NULL);
g_signal_handlers_disconnect_by_func (surface, surface_expose, widget);
g_signal_handlers_disconnect_by_func (surface, surface_event, widget);
}
/**