Add coordinates to handle_crossing
This will be needed for pointer crossing events.
This commit is contained in:
@@ -129,7 +129,9 @@ gtk_event_controller_handle_event_default (GtkEventController *self,
|
||||
|
||||
static void
|
||||
gtk_event_controller_handle_crossing_default (GtkEventController *self,
|
||||
const GtkCrossingData *crossing)
|
||||
const GtkCrossingData *crossing,
|
||||
double x,
|
||||
double y)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -318,13 +320,17 @@ gtk_event_controller_handle_event (GtkEventController *controller,
|
||||
* gtk_event_controller_handle_crossing:
|
||||
* @controller: a #GtkEventController
|
||||
* @crossing: a #GtkCrossingData
|
||||
* @x: event position in widget coordinates
|
||||
* @y: event position in widget coordinates
|
||||
*
|
||||
* Feeds a crossing event into @controller, so it can be interpreted
|
||||
* and the controller actions triggered.
|
||||
**/
|
||||
void
|
||||
gtk_event_controller_handle_crossing (GtkEventController *controller,
|
||||
const GtkCrossingData *crossing)
|
||||
const GtkCrossingData *crossing,
|
||||
double x,
|
||||
double y)
|
||||
{
|
||||
GtkEventControllerClass *controller_class;
|
||||
|
||||
@@ -334,7 +340,7 @@ gtk_event_controller_handle_crossing (GtkEventController *controller,
|
||||
controller_class = GTK_EVENT_CONTROLLER_GET_CLASS (controller);
|
||||
|
||||
g_object_ref (controller);
|
||||
controller_class->handle_crossing (controller, crossing);
|
||||
controller_class->handle_crossing (controller, crossing, x, y);
|
||||
g_object_unref (controller);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,8 @@ G_BEGIN_DECLS
|
||||
typedef struct _GtkCrossingData GtkCrossingData;
|
||||
|
||||
typedef enum {
|
||||
GTK_CROSSING_FOCUS
|
||||
GTK_CROSSING_FOCUS,
|
||||
GTK_CROSSING_POINTER
|
||||
} GtkCrossingType;
|
||||
|
||||
typedef enum {
|
||||
@@ -90,7 +91,9 @@ gboolean gtk_event_controller_handle_event (GtkEventController *controller
|
||||
double y);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_event_controller_handle_crossing (GtkEventController *controller,
|
||||
const GtkCrossingData *crossing);
|
||||
const GtkCrossingData *crossing,
|
||||
double x,
|
||||
double y);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_event_controller_reset (GtkEventController *controller);
|
||||
|
||||
|
||||
@@ -193,7 +193,9 @@ update_focus (GtkEventController *controller,
|
||||
|
||||
static void
|
||||
gtk_event_controller_key_handle_crossing (GtkEventController *controller,
|
||||
const GtkCrossingData *crossing)
|
||||
const GtkCrossingData *crossing,
|
||||
double x,
|
||||
double y)
|
||||
{
|
||||
if (crossing->type != GTK_CROSSING_FOCUS)
|
||||
return;
|
||||
|
||||
@@ -41,7 +41,9 @@ struct _GtkEventControllerClass
|
||||
void (* reset) (GtkEventController *controller);
|
||||
|
||||
void (* handle_crossing) (GtkEventController *controller,
|
||||
const GtkCrossingData *crossing);
|
||||
const GtkCrossingData *crossing,
|
||||
double x,
|
||||
double y);
|
||||
|
||||
/*<private>*/
|
||||
|
||||
|
||||
@@ -4822,7 +4822,9 @@ gtk_widget_run_controllers (GtkWidget *widget,
|
||||
|
||||
void
|
||||
gtk_widget_handle_crossing (GtkWidget *widget,
|
||||
const GtkCrossingData *crossing)
|
||||
const GtkCrossingData *crossing,
|
||||
double x,
|
||||
double y)
|
||||
{
|
||||
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
|
||||
GList *l;
|
||||
@@ -4833,7 +4835,7 @@ gtk_widget_handle_crossing (GtkWidget *widget,
|
||||
{
|
||||
GtkEventController *controller = l->data;
|
||||
|
||||
gtk_event_controller_handle_crossing (controller, crossing);
|
||||
gtk_event_controller_handle_crossing (controller, crossing, x, y);
|
||||
}
|
||||
|
||||
g_object_unref (widget);
|
||||
|
||||
@@ -348,7 +348,9 @@ gboolean gtk_widget_run_controllers (GtkWidget
|
||||
double y,
|
||||
GtkPropagationPhase phase);
|
||||
void gtk_widget_handle_crossing (GtkWidget *widget,
|
||||
const GtkCrossingData *crossing);
|
||||
const GtkCrossingData *crossing,
|
||||
double x,
|
||||
double y);
|
||||
|
||||
|
||||
guint gtk_widget_add_surface_transform_changed_callback (GtkWidget *widget,
|
||||
|
||||
@@ -6371,7 +6371,7 @@ synthesize_focus_change_events (GtkWindow *window,
|
||||
widget = old_focus;
|
||||
while (widget)
|
||||
{
|
||||
gtk_widget_handle_crossing (widget, &crossing);
|
||||
gtk_widget_handle_crossing (widget, &crossing, 0, 0);
|
||||
gtk_widget_unset_state_flags (widget, flags);
|
||||
gtk_widget_set_focus_child (widget, NULL);
|
||||
widget = gtk_widget_get_parent (widget);
|
||||
@@ -6394,7 +6394,7 @@ synthesize_focus_change_events (GtkWindow *window,
|
||||
focus_child = l->next->data;
|
||||
else
|
||||
focus_child = NULL;
|
||||
gtk_widget_handle_crossing (widget, &crossing);
|
||||
gtk_widget_handle_crossing (widget, &crossing, 0, 0);
|
||||
gtk_widget_set_state_flags (widget, flags, FALSE);
|
||||
gtk_widget_set_focus_child (widget, focus_child);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user