You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DeviceEventFilter works differently on X11 and Windows #2591
This is likely owed to none of us catching that the initial implementation (#2195) had the documentation be different from the actual behavior of the X11 backend. Specifically, the behavior of DeviceEventFilter::Always and DeviceEventFilter::Never is flipped WRT the documentation. Due to this, the subsequent Windows implementation (#2409) followed the documentation, thus leading to further inconsistency.
I'm personally of the opinion that the way it works on X11 is the most intuitive, and that the documentation and the Windows backend should be adjusted accordingly. However, I'd like to get the opinion of others before doing anything.
Oh boys... one of them classic double negative logics. We should probably rename the enum, since changing an implementation will be a breaking-change anyways.
I propose the new name to be DeviceEventsAllowed.
And change the Unfocused variant to Focused
enumDeviceEvents{All,WhenFocused,Never,}implWindow{fnlisten_device_events(...);}// Usage is pretty clear as
window.listen_device_events(DeviceEvents::All);
window.listen_device_events(DeviceEvents::WhenFocused);
window.listen_device_events(DeviceEvents::Never);
Would a PR be acceptable to at least fix it without a breaking change for a potential Winit v0.28.2?
So meaning it should be properly flipped for X11 to follow the documentation.
Happy to do the PR for what @madsmtm suggested too.
Activity
kchibisov commentedon Dec 15, 2022
I read the docs, and they tell the correct thing?
Alwaysshould always filter, no?Nevermeans never filter.I think that's how it works.
ArturKovacs commentedon Dec 15, 2022
Oh boys... one of them classic double negative logics. We should probably rename the enum, since changing an implementation will be a breaking-change anyways.
I propose the new name to be
DeviceEventsAllowed.And change the
Unfocusedvariant toFocusedmadsmtm commentedon Dec 15, 2022
Agree with @ArturKovacs, perhaps even:
kchibisov commentedon Dec 15, 2022
Up to you, I don't really mind that change.
daxpedda commentedon Feb 26, 2023
Would a PR be acceptable to at least fix it without a breaking change for a potential Winit v0.28.2?
So meaning it should be properly flipped for X11 to follow the documentation.
Happy to do the PR for what @madsmtm suggested too.
follow up on rust-windowing#2591