linebender / glazier

Deprecated Rust Window Creation Library
Apache License 2.0
206 stars 32 forks source link

Pass PointerEvent/ KeyEvent by ref. #166

Closed waywardmonkeys closed 1 year ago

waywardmonkeys commented 1 year ago

This reverts #129 (87b132c) which had changed PointerEvent to pass by value rather than ref.

Since KeyboardEvent has a cost to clone / copy, this may be a better approach.

waywardmonkeys commented 1 year ago

This has been annoying me for a while, so I thought maybe I'd submit it for discussion.

If we're going to go this route, I'd rather do this before we update glazier.

waywardmonkeys commented 1 year ago

Err, before we update xilem.

waywardmonkeys commented 1 year ago

This seems like a good use case for pass by reference. Are there any other events that we should change to make it more consistent?

The other things on WinHandler seem fine as they are ... tokens mostly or scalar arguments.