mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
macos: allow dropping NSEvent without propagation
There are cases we might want to consume a NSEvent without creating a GdkEvent or passing it along to the NSApplication for processing. This creates a new value we can use and check against to propagate that without having to do out parameters at the slightly odd invalid pointer value for a GdkEvent (similar to how MMAP_FAILED is done).
This commit is contained in:
parent
b390e1da4f
commit
32935d9fb0
@ -43,6 +43,8 @@ G_BEGIN_DECLS
|
||||
#define GIC_FILTER_PASSTHRU 0
|
||||
#define GIC_FILTER_FILTERED 1
|
||||
|
||||
#define GDK_MACOS_EVENT_DROP (GdkEvent *)GSIZE_TO_POINTER(1)
|
||||
|
||||
struct _GdkMacosDisplay
|
||||
{
|
||||
GdkDisplay parent_instance;
|
||||
|
@ -314,7 +314,11 @@ gdk_macos_display_queue_events (GdkDisplay *display)
|
||||
{
|
||||
GdkEvent *event = _gdk_macos_display_translate (self, nsevent);
|
||||
|
||||
if (event != NULL)
|
||||
if (event == GDK_MACOS_EVENT_DROP)
|
||||
{
|
||||
[nsevent release];
|
||||
}
|
||||
else if (event != NULL)
|
||||
{
|
||||
push_nsevent (event, nsevent);
|
||||
_gdk_windowing_got_event (GDK_DISPLAY (self),
|
||||
|
Loading…
Reference in New Issue
Block a user