gdk: Add crossing mode and detail to focus events

We want focus events more similar to crossing events.
This commit is contained in:
Matthias Clasen 2019-03-06 16:55:27 -05:00
parent a3abf0693d
commit 8d5f1ae662
2 changed files with 14 additions and 0 deletions

View File

@ -1980,6 +1980,11 @@ gdk_event_get_crossing_mode (const GdkEvent *event,
*mode = event->crossing.mode;
return TRUE;
}
else if (event->any.type == GDK_FOCUS_CHANGE)
{
*mode = event->focus_change.mode;
return TRUE;
}
return FALSE;
}
@ -2006,6 +2011,11 @@ gdk_event_get_crossing_detail (const GdkEvent *event,
*detail = event->crossing.detail;
return TRUE;
}
else if (event->any.type == GDK_FOCUS_CHANGE)
{
*detail = event->focus_change.detail;
return TRUE;
}
return FALSE;
}

View File

@ -312,6 +312,8 @@ struct _GdkEventCrossing
* @send_event: %TRUE if the event was sent explicitly.
* @in: %TRUE if the surface has gained the keyboard focus, %FALSE if
* it has lost the focus.
* @mode: the crossing mode
* @detail: the kind of crossing that happened
*
* Describes a change of keyboard focus.
*/
@ -319,6 +321,8 @@ struct _GdkEventFocus
{
GdkEventAny any;
gint16 in;
GdkCrossingMode mode;
GdkNotifyType detail;
};
/*