FlutterWayland / flutter_wlroots

Wayland compositor embedder and library for Flutter. Built with Wlroots.
MIT License
30 stars 5 forks source link

[WIP] Basic WM #14

Open charafau opened 2 years ago

charafau commented 2 years ago

Done:

Todo: Get actual surface size from wlroots view is actually resized when first appearing (SizeBox defines size) - we should probably check if that size or alright.

HrX03 commented 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

hansihe commented 2 years ago

How do you think the best way would be to make a proper event API?

HrX03 commented 2 years ago

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)

charafau commented 1 year ago

There's some breakage after merge. Need to fix that