[GTK4] GdkEvents being private breaks certain use cases
In GTK4 the GdkEvent structs became private, meaning that synthetic/custom GdkEvents can no longer be created by applications.
We (SWT) have two main use-cases that are impacted by this:
-
Menus: the new API in 3.22 uses GdkEvents -- often we call this API using GdkEvents we create ourselves, as no current GdkEvent is on-hand. This is quite important to us as most our Menu API is affected. It's also useful as we can use the GtkMenu API to popup menus whenever we like.
-
Test functionality: in GTK3 (on X11) it was possible to simulate key/button events using gdk_test_simulate_[button/key]. In GTK4 these functions are removed, and on Wayland they didn't work very well in GTK3 either. Our workaround was to create GdkEvents ourselves and feed them to the event stack. With GdkEvents being private this is no longer possible. I understand that feeding GdkEvents to the event stack might be problematic, so even a replacement for the gdk_test_simulate_* functions would be nice.
In summary: it would be very beneficial to SWT if GdkEvents were kept public, or if there was a way (via API) to create/manipulate GdkEvents ourselves.