forked from AuroraMiddleware/gtk
widget: Connect to GdkSurface::event
This lets us handle input events the same way we do expose events.
This commit is contained in:
parent
23fb77af43
commit
d633beaccd
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user