Skip to content

macOS: Add fix for ModifiersChanged relocation#2

Merged
murarth merged 2 commits intomurarth:modifiers-changed-window-eventfrom
rye:modifiers-changed-window-event-macos
Jan 22, 2020
Merged

macOS: Add fix for ModifiersChanged relocation#2
murarth merged 2 commits intomurarth:modifiers-changed-window-eventfrom
rye:modifiers-changed-window-event-macos

Conversation

@rye
Copy link
Copy Markdown

@rye rye commented Jan 22, 2020

(I've removed the checklist here because it didn't seem too important.)

This PR:

  • Makes macOS build happily again simply by re-pointing the DeviceEvent elsewhere.
  • Adds a call in the WindowDelegate to send an empty list of modifiers after the window loses focus.
    • I'm not aware of a way on macOS that you can switch to a window and still have modifiers held down.

I tested this by running the window_debug example and observing traces, which have since been removed.

rye added 2 commits January 22, 2020 08:25
I haven't look too deep at what this does internally, but at least
cargo-check is fully happy now. :)

Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>
From debugging, I determined that macOS' emission of a flagsChanged
around window switching is inconsistent.  It is fair to assume, I think,
that when the user switches windows, they do not expect their former
modifiers state to remain effective; so I think it's best to clear that
state by sending a ModifiersChanged(ModifiersState::empty()).

Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>
@murarth murarth merged commit 785d83e into murarth:modifiers-changed-window-event Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants