macos: Retrieve NSEvents based on event properties

We cannot depend on the exact event, since some events (e.g. for popups)
are rewritten. Therefore we need to determine the NSEvent based on
heuristics. The usual suspects are event type, device and timestamp.

This allows us to fix IMContext for popups.
This commit is contained in:
Arjan Molenaar 2024-03-16 17:22:21 +01:00
parent 60ddf7c421
commit 4fd848c9de

View File

@ -998,7 +998,9 @@ _gdk_macos_display_get_nsevent (GdkEvent *event)
{
const GdkToNSEventMap *map = iter->data;
if (map->gdk_event == event)
if (map->gdk_event->event_type == event->event_type &&
map->gdk_event->device == event->device &&
map->gdk_event->time == event->time)
return map->nsevent;
}