Skip to content

Commit

Permalink
Make PointerTarget/KeyboardTarget object-safe; use in Anvil
Browse files Browse the repository at this point in the history
I've been thinking about how to simplify this code for a while.
Implementations of these traits become particularly verbose with a more
complicated shell like cosmic-comp:
https://github.com/pop-os/cosmic-comp/blob/master/src/shell/focus/target.rs.

It turns out it can be made object-safe, so we can have a `&dyn
PointerTarget`, if `PartialEq` and `Clone` requirements are moved out of
the trait itself.

I still wonder if it could be better to use enums for input events
instead of a million methods. Anyway, something to think about.
  • Loading branch information
ids1024 committed Mar 26, 2024
1 parent e5f0068 commit 179e750
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 188 deletions.
Loading

0 comments on commit 179e750

Please sign in to comment.