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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user