Skip to content
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

[Merged by Bors] - Expose set_cursor_hittest() from winit #6664

Closed

Conversation

alphastrata
Copy link
Contributor

Objective

  • Bevy should be usable to create 'overlay' type apps, where the input is not captured by Bevy, but passed down/into a target app, or to allow passive displays/widgets etc.

Solution

  • the winit::window::Window already has a set_cursor_hittest() which basically does this for mouse input events, so I've exposed it (trying to copy the style laid out in the existing wrappings, and added a simple demo.

Changelog

  • Added hittest to WindowAttributes
  • Added the hittest's setters/getters
  • Modified the WindowBuilder
  • Modifed the WindowDescriptor's Default impl.
  • Added an example cargo run --example fallthrough

@alice-i-cecile
Copy link
Member

Related to #3570.

@alice-i-cecile alice-i-cecile added C-Feature A new feature, making something new possible A-Input Player input via keyboard, mouse, gamepad, and more A-Windowing Platform-agnostic interface layer to run your app in A-UI Graphical user interfaces, styles, layouts, and widgets labels Nov 17, 2022
@alphastrata
Copy link
Contributor Author

@alice-i-cecile I'm not really sure how to solve the Dependency error being thrown by this CI.

error[duplicate]: found 2 duplicate entries for crate 'windows'
    ┌─ /home/runner/work/bevy/bevy/Cargo.lock:331:1
    │  
331 │ ╭ windows 0.37.0 registry+https://github.com/rust-lang/crates.io-index
332 │ │ windows 0.43.0 registry+https://github.com/rust-lang/crates.io-index
    │ ╰────────────────────────────────────────────────────────────────────^ lock entries
    │ 

Is anyone able to lend a hand? (appologies for atting you directly) -- I tried the usual removing the .lock etc but as I didn't touch any of the dependencies I'm not actually sure how it is that I created this error.

Cargo.toml Outdated Show resolved Hide resolved
@mockersf
Copy link
Member

Is anyone able to lend a hand?

This is not related to your PR, you can ignore it

alphastrata and others added 3 commits November 18, 2022 18:46
Co-authored-by: François <[email protected]>
- remove arbitrary width/height consts from example.
- remove logging from example
- rename example
Cargo.toml Outdated Show resolved Hide resolved
Co-authored-by: François <[email protected]>
@alphastrata
Copy link
Contributor Author

cargo run -p build-example-pages -- update throws an index not found error, is there something else with the paths/.toml I need to sort out?

Cargo.toml Show resolved Hide resolved
add wasm=false flag

Co-authored-by: François <[email protected]>
@mockersf
Copy link
Member

mockersf commented Nov 19, 2022

it should work now if you run cargo run -p build-example-pages -- update 👍

@alphastrata
Copy link
Contributor Author

This all good now?

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I'm happy with this now.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Nov 21, 2022
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Nov 21, 2022
# Objective

- Bevy should be usable to create 'overlay' type apps, where the input is not captured by Bevy, but passed down/into a target app, or to allow passive displays/widgets etc.
 
## Solution

- the `winit::window::Window` already has a `set_cursor_hittest()` which basically does this for mouse input events, so I've exposed it (trying to copy the style laid out in the existing wrappings, and added a simple demo.

---

## Changelog

- Added `hittest` to `WindowAttributes`
- Added the `hittest`'s setters/getters
- Modified the `WindowBuilder`
- Modifed the `WindowDescriptor`'s `Default` impl.
- Added an example `cargo run --example fallthrough`
@bors bors bot changed the title Expose set_cursor_hittest() from winit [Merged by Bors] - Expose set_cursor_hittest() from winit Nov 21, 2022
@bors bors bot closed this Nov 21, 2022
taiyoungjang pushed a commit to taiyoungjang/bevy that referenced this pull request Dec 15, 2022
# Objective

- Bevy should be usable to create 'overlay' type apps, where the input is not captured by Bevy, but passed down/into a target app, or to allow passive displays/widgets etc.
 
## Solution

- the `winit::window::Window` already has a `set_cursor_hittest()` which basically does this for mouse input events, so I've exposed it (trying to copy the style laid out in the existing wrappings, and added a simple demo.

---

## Changelog

- Added `hittest` to `WindowAttributes`
- Added the `hittest`'s setters/getters
- Modified the `WindowBuilder`
- Modifed the `WindowDescriptor`'s `Default` impl.
- Added an example `cargo run --example fallthrough`
alradish pushed a commit to alradish/bevy that referenced this pull request Jan 22, 2023
# Objective

- Bevy should be usable to create 'overlay' type apps, where the input is not captured by Bevy, but passed down/into a target app, or to allow passive displays/widgets etc.
 
## Solution

- the `winit::window::Window` already has a `set_cursor_hittest()` which basically does this for mouse input events, so I've exposed it (trying to copy the style laid out in the existing wrappings, and added a simple demo.

---

## Changelog

- Added `hittest` to `WindowAttributes`
- Added the `hittest`'s setters/getters
- Modified the `WindowBuilder`
- Modifed the `WindowDescriptor`'s `Default` impl.
- Added an example `cargo run --example fallthrough`
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

- Bevy should be usable to create 'overlay' type apps, where the input is not captured by Bevy, but passed down/into a target app, or to allow passive displays/widgets etc.
 
## Solution

- the `winit::window::Window` already has a `set_cursor_hittest()` which basically does this for mouse input events, so I've exposed it (trying to copy the style laid out in the existing wrappings, and added a simple demo.

---

## Changelog

- Added `hittest` to `WindowAttributes`
- Added the `hittest`'s setters/getters
- Modified the `WindowBuilder`
- Modifed the `WindowDescriptor`'s `Default` impl.
- Added an example `cargo run --example fallthrough`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more A-UI Graphical user interfaces, styles, layouts, and widgets A-Windowing Platform-agnostic interface layer to run your app in C-Feature A new feature, making something new possible S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants