Skip to content

On Web, enable event propagation#3062

Merged
daxpedda merged 1 commit intorust-windowing:masterfrom
daxpedda:event-propagation
Aug 28, 2023
Merged

On Web, enable event propagation#3062
daxpedda merged 1 commit intorust-windowing:masterfrom
daxpedda:event-propagation

Conversation

@daxpedda
Copy link
Member

This PR removes the code originally stopping events from being propagated from the canvas. The code inserting DeviceEvents before WindowEvents was also removed, de-duplicating a bunch of code.

The motivation here is the following:

  • Reduce the side effects Winit has on the overall webpage that might or might not be desirable. Similar to Implement ResizeObserver #2859.
  • Activating fullscreen requires a transient activation, which until now we detected by hijacking some already used events on the canvas. This isn't ideal because transient activation can happen anywhere on the page. Now that we have enabled event propagation, we can register events on the window to detect those activations.
  • Remove more unnecessary code!

@daxpedda daxpedda added the DS - web Affects the Web backend (WebAssembly/WASM) label Aug 28, 2023
@daxpedda daxpedda merged commit 1dfca5a into rust-windowing:master Aug 28, 2023
kchibisov pushed a commit to kchibisov/winit that referenced this pull request Oct 17, 2023
kchibisov pushed a commit that referenced this pull request Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DS - web Affects the Web backend (WebAssembly/WASM)

Development

Successfully merging this pull request may close these issues.

1 participant