GNOME Bugzilla – Bug 682788
Hide the ClutterEvent structure contents
Last modified: 2021-06-10 11:30:53 UTC
ClutterEvent should be fully opaque to the user, and only offer accessor functions to retrieve its state. Synthetic ClutterEvent should only be allocated through clutter_event_new(), and never be placed on the stack.
Created attachment 222557 [details] [review] event: Make event structure opaque ClutterEvent should not be fully exposed to the C developer: it prevents us from expanding the event-related API, and forces us to use nasty tricks to add platform-specific or extended data without breaking the ABI for people placing events on the stack.
one thing we need to determine is whether to remove copy/free and make Event a refcounted type, or add copy-on-write semantics for Events. we could make it so that events are mutable by default, until pushed onto the queue, after which they become immutable and can only be copied in order to be modified. for instance: event = clutter_event_create_pointer (PRESS, &coords, button, state, time). assert (event.is_mutable()) clutter_event_set_foo (event, blah) clutter_event_push (event); assert (!event.is_mutable()) clutter_event_set_foo (event, blah) ← warns and fails
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of clutter, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a ticket at https://gitlab.gnome.org/GNOME/clutter/-/issues/ Thank you for your understanding and your help.