Skip to content

[Merged by Bors] - Make raw_window_handle field in Window and ExtractedWindow an Option. - #6114

Closed
targrub wants to merge 15 commits into
bevyengine:mainfrom
targrub:OptionalRawHandle
Closed

targrub wants to merge 15 commits into
bevyengine:mainfrom
targrub:OptionalRawHandle

Conversation

@targrub

@targrub targrub commented Sep 27, 2022 •

Copy link
Copy Markdown
Contributor

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

targrub commented Sep 27, 2022

Copy link
Copy Markdown
Contributor Author

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
Comment thread crates/bevy_render/src/lib.rs Outdated
Comment thread crates/bevy_render/src/view/window.rs Outdated
Comment thread crates/bevy_window/src/window.rs Outdated
@targrub
targrub marked this pull request as ready for review September 27, 2022 18:49
@Nilirad Nilirad added the M-Migration-Guide 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
Copy Markdown
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.

Comment thread crates/bevy_window/src/window.rs Outdated
Comment thread crates/bevy_render/src/lib.rs Outdated
@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
Copy Markdown
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 commented Oct 17, 2022

Copy link
Copy Markdown

@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-Testing A change that impacts how we test Bevy or how users test their apps M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide 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