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] - Make raw_window_handle field in Window and ExtractedWindow an Option. #6114

Closed
wants to merge 15 commits into from

Conversation

targrub
Copy link
Contributor

@targrub targrub commented Sep 27, 2022

Objective

Solution

  • Make the interface and type changes. Avoid accessing None.

Changelog

  • Converted raw_window_handle field in both Window and ExtractedWindow to Option<RawWindowHandleWrapper>.
  • Revised accessor function Window::raw_window_handle() to return Option<RawWindowHandleWrapper>.
  • Skip conditions in loops that would require a raw window handle (to create a Surface, for example).

Migration Guide

Window::raw_window_handle() now returns Option<RawWindowHandleWrapper>.

@targrub
Copy link
Contributor Author

targrub commented Sep 27, 2022

Incorporates #6110 code changes. Its PR documentation should be considered a part of this PR's documentation. Therefore, its Migration Guide should be added with this PR's.

@alice-i-cecile alice-i-cecile added A-Windowing Platform-agnostic interface layer to run your app in C-Testing A change that impacts how we test Bevy or how users test their apps labels Sep 27, 2022
@targrub targrub marked this pull request as ready for review September 27, 2022 18:49
@Nilirad Nilirad added the C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide label Sep 28, 2022
@targrub targrub marked this pull request as draft September 28, 2022 18:16
@targrub targrub marked this pull request as ready for review September 29, 2022 01:42
@alice-i-cecile
Copy link
Member

This LGTM now. This is overall a very small change that will make testing this code much easier, for both users and the engine.

@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 Oct 15, 2022
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Oct 17, 2022
…Option`. (#6114)

# Objective

- Trying to make it possible to do write tests that don't require a raw window handle.
- Fixes #6106.

## Solution

- Make the interface and type changes.  Avoid accessing `None`.
---

## Changelog

- Converted `raw_window_handle` field in both `Window` and `ExtractedWindow` to `Option<RawWindowHandleWrapper>`.
- Revised accessor function `Window::raw_window_handle()` to return `Option<RawWindowHandleWrapper>`.
- Skip conditions in loops that would require a raw window handle (to create a `Surface`, for example).

## Migration Guide

`Window::raw_window_handle()` now returns `Option<RawWindowHandleWrapper>`.


Co-authored-by: targrub <62773321+targrub@users.noreply.github.com>
@bors bors bot changed the title Make raw_window_handle field in Window and ExtractedWindow an Option. [Merged by Bors] - Make raw_window_handle field in Window and ExtractedWindow an Option. Oct 17, 2022
@bors bors bot closed this Oct 17, 2022
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 19, 2022
…Option`. (bevyengine#6114)

# Objective

- Trying to make it possible to do write tests that don't require a raw window handle.
- Fixes bevyengine#6106.

## Solution

- Make the interface and type changes.  Avoid accessing `None`.
---

## Changelog

- Converted `raw_window_handle` field in both `Window` and `ExtractedWindow` to `Option<RawWindowHandleWrapper>`.
- Revised accessor function `Window::raw_window_handle()` to return `Option<RawWindowHandleWrapper>`.
- Skip conditions in loops that would require a raw window handle (to create a `Surface`, for example).

## Migration Guide

`Window::raw_window_handle()` now returns `Option<RawWindowHandleWrapper>`.


Co-authored-by: targrub <62773321+targrub@users.noreply.github.com>
@targrub targrub deleted the OptionalRawHandle branch October 26, 2022 19:39
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
…Option`. (bevyengine#6114)

# Objective

- Trying to make it possible to do write tests that don't require a raw window handle.
- Fixes bevyengine#6106.

## Solution

- Make the interface and type changes.  Avoid accessing `None`.
---

## Changelog

- Converted `raw_window_handle` field in both `Window` and `ExtractedWindow` to `Option<RawWindowHandleWrapper>`.
- Revised accessor function `Window::raw_window_handle()` to return `Option<RawWindowHandleWrapper>`.
- Skip conditions in loops that would require a raw window handle (to create a `Surface`, for example).

## Migration Guide

`Window::raw_window_handle()` now returns `Option<RawWindowHandleWrapper>`.


Co-authored-by: targrub <62773321+targrub@users.noreply.github.com>
Pietrek14 pushed a commit to Pietrek14/bevy that referenced this pull request Dec 17, 2022
…Option`. (bevyengine#6114)

# Objective

- Trying to make it possible to do write tests that don't require a raw window handle.
- Fixes bevyengine#6106.

## Solution

- Make the interface and type changes.  Avoid accessing `None`.
---

## Changelog

- Converted `raw_window_handle` field in both `Window` and `ExtractedWindow` to `Option<RawWindowHandleWrapper>`.
- Revised accessor function `Window::raw_window_handle()` to return `Option<RawWindowHandleWrapper>`.
- Skip conditions in loops that would require a raw window handle (to create a `Surface`, for example).

## Migration Guide

`Window::raw_window_handle()` now returns `Option<RawWindowHandleWrapper>`.


Co-authored-by: targrub <62773321+targrub@users.noreply.github.com>
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
…Option`. (bevyengine#6114)

# Objective

- Trying to make it possible to do write tests that don't require a raw window handle.
- Fixes bevyengine#6106.

## Solution

- Make the interface and type changes.  Avoid accessing `None`.
---

## Changelog

- Converted `raw_window_handle` field in both `Window` and `ExtractedWindow` to `Option<RawWindowHandleWrapper>`.
- Revised accessor function `Window::raw_window_handle()` to return `Option<RawWindowHandleWrapper>`.
- Skip conditions in loops that would require a raw window handle (to create a `Surface`, for example).

## Migration Guide

`Window::raw_window_handle()` now returns `Option<RawWindowHandleWrapper>`.


Co-authored-by: targrub <62773321+targrub@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Windowing Platform-agnostic interface layer to run your app in C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide C-Testing A change that impacts how we test Bevy or how users test their apps 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.

Make Window and Windows structs easier to test with
6 participants