Open charafau opened 2 years ago
I wonder if it would be appropriate to introduce a proper event api in this pr or it would be better to have it as a different pr. If a different pr would be optimal then i could work on it once this pr gets eventually merged
How do you think the best way would be to make a proper event API?
I already did an event api for utopia and i think we could lean towards that kind of architecture. Basically, you add a listener of sorts to the event source which is nothing more than a callback method that gets called each time any event happens. It has one single params which is a subclass of an abstract Event
class that represents the kind of event that was generated. You just have to do some type checking to see which event was generated, eventually cast the param (tho usually it's automatically done as long as it's locally scoped) and then access the instance params and do your thing.
Basically it would be something like Compositor.addEventHandler(callback)
where callback is of type void Function(Event)
There's some breakage after merge. Need to fix that
Done:
Todo:
Get actual surface size from wlrootsview is actually resized when first appearing (SizeBox defines size) - we should probably check if that size or alright.