-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make PointerTarget
/KeyboardTarget
/TouchTarget
object-safe; use in Anvil
#1334
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1334 +/- ##
==========================================
+ Coverage 21.31% 21.35% +0.03%
==========================================
Files 156 156
Lines 25141 25095 -46
==========================================
Hits 5359 5359
+ Misses 19782 19736 -46
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
So, the reason for the removal of the For example the default I did look into what cosmic is doing with the targets (turns out quite a lot in case of All I did so far in cosmic is shuffle around a few implementations and try out a few ideas. This requires to resolve the whole focus stack when the pointer moves in cosmic, should make it possible to keep most of the other focus logic in cosmic as is while still fixing the grab stuff. Feedback very welcome :) |
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.
44173d9
to
179e750
Compare
PointerTarget
/KeyboardTarget
object-safe; use in AnvilPointerTarget
/KeyboardTarget
/TouchTarget
object-safe; use in Anvil
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 make object-safe, so we can have a
&dyn PointerTarget
, ifPartialEq
andClone
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.
Leaving as a draft pending the other changes in input targets in #1326.