Skip to content

Make ClutterEvent opaque and immutable structs

This MR:

  • Adds specific constructor methods for each of the various events that may be created, and uses them in every place where events are created
  • Adds missing getter methods, ports everything to use getter methods instead of direct struct access
  • Drops setter methods, takes different approaches for the places that events were modified post-creation (e.g. motion compression)
  • Moves the ClutterEvent union/struct definitions out of public headers

Overall, this means events become immutable, and opaque to avoid manual fiddling, constructor methods are declared in mutter-only headers, so it's also no longer possible to create events outside of mutter.

There were some changes to the data held in events:

  • clutter_event_set_pointer_emulated() is now a ClutterEventFlag
  • There is no longer ClutterStage data in the event as events get first created then delivered across an stage.

There is not much of a cleanup yet over the ClutterEventPrivate/ClutterEvent split of data, but that is now ripe for future MRs.

Merge request reports