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

Close window (pipelined-rendering) #2898

Closed
wants to merge 10 commits into from

Conversation

DJMcNab
Copy link
Member

@DJMcNab DJMcNab commented Oct 1, 2021

Objective

  • We didn't have any way to close specific windows

Solution

  • Integrate closing windows properly

Note that this still has some issues with bevy_render - in particular, I'm unsure what to do to/about the corresponding WindowTextureNode/WindowSwapChainNode when the window is closed.

At the moment, we panic whenever a window is closed, assuming it had anything drawn to it. This is not ideal.

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Oct 1, 2021
@DJMcNab DJMcNab added A-Windowing Platform-agnostic interface layer to run your app in C-Enhancement A new feature S-Needs-Investigation This issue requires detective work to figure out what's going wrong and removed S-Needs-Triage This issue needs to be labelled labels Oct 1, 2021
}
}
}
if removed_windows.len() > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

!removed_windows.is_empty() ?

@DJMcNab DJMcNab added S-Blocked This cannot move forward until something else changes and removed S-Needs-Investigation This issue requires detective work to figure out what's going wrong labels Oct 1, 2021
@DJMcNab
Copy link
Member Author

DJMcNab commented Oct 1, 2021

Fixing the render should wait until the new renderer is merged, unless this gets moved over to there.

@DJMcNab DJMcNab changed the base branch from main to pipelined-rendering October 2, 2021 09:22
@DJMcNab DJMcNab removed the S-Blocked This cannot move forward until something else changes label Oct 2, 2021
@DJMcNab DJMcNab changed the title Close window Close window (pipelined-rendering) Oct 2, 2021
@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 9, 2021
@DJMcNab
Copy link
Member Author

DJMcNab commented Nov 24, 2021

Pipelined has been merged, might re-open later.

@DJMcNab DJMcNab closed this Nov 24, 2021
@DJMcNab DJMcNab deleted the close-window branch November 24, 2021 21:48
@DJMcNab DJMcNab mentioned this pull request Dec 4, 2021
bors bot pushed a commit that referenced this pull request Dec 18, 2021
# Objective

- The multiple windows example which was viciously murdered in #3175.
- cart asked me to

## Solution

- Rework the example to work on pipelined-rendering, based on the work from #2898
bors bot pushed a commit that referenced this pull request May 5, 2022
# Objective

Fixes #3180, builds from #2898

## Solution

Support requesting a window to be closed and closing a window in `bevy_window`, and handle this in `bevy_winit`.

This is a stopgap until we move to windows as entites, which I'm sure I'll get around to eventually.

## Changelog

### Added

- `Window::close` to allow closing windows.
- `WindowClosed` to allow reacting to windows being closed.

### Changed

Replaced `bevy::system::exit_on_esc_system` with `bevy::window::close_on_esc`.

## Fixed

The app no longer exits when any window is closed. This difference is only observable when there are multiple windows. 

## Migration Guide

`bevy::system::exit_on_esc_system` has been removed. Use `bevy::window::close_on_esc` instead.
`CloseWindow` has been removed. Use `Window::close` instead.
The `Close` variant has been added to `WindowCommand`. Handle this by closing the relevant window.
bors bot pushed a commit that referenced this pull request May 5, 2022
# Objective

Fixes #3180, builds from #2898

## Solution

Support requesting a window to be closed and closing a window in `bevy_window`, and handle this in `bevy_winit`.

This is a stopgap until we move to windows as entites, which I'm sure I'll get around to eventually.

## Changelog

### Added

- `Window::close` to allow closing windows.
- `WindowClosed` to allow reacting to windows being closed.

### Changed

Replaced `bevy::system::exit_on_esc_system` with `bevy::window::close_on_esc`.

## Fixed

The app no longer exits when any window is closed. This difference is only observable when there are multiple windows. 

## Migration Guide

`bevy::input::system::exit_on_esc_system` has been removed. Use `bevy::window::close_on_esc` instead.
`CloseWindow` has been removed. Use `Window::close` instead.
The `Close` variant has been added to `WindowCommand`. Handle this by closing the relevant window.
robtfm pushed a commit to robtfm/bevy that referenced this pull request May 10, 2022
# Objective

Fixes bevyengine#3180, builds from bevyengine#2898

## Solution

Support requesting a window to be closed and closing a window in `bevy_window`, and handle this in `bevy_winit`.

This is a stopgap until we move to windows as entites, which I'm sure I'll get around to eventually.

## Changelog

### Added

- `Window::close` to allow closing windows.
- `WindowClosed` to allow reacting to windows being closed.

### Changed

Replaced `bevy::system::exit_on_esc_system` with `bevy::window::close_on_esc`.

## Fixed

The app no longer exits when any window is closed. This difference is only observable when there are multiple windows. 

## Migration Guide

`bevy::input::system::exit_on_esc_system` has been removed. Use `bevy::window::close_on_esc` instead.
`CloseWindow` has been removed. Use `Window::close` instead.
The `Close` variant has been added to `WindowCommand`. Handle this by closing the relevant window.
exjam pushed a commit to exjam/bevy that referenced this pull request May 22, 2022
# Objective

Fixes bevyengine#3180, builds from bevyengine#2898

## Solution

Support requesting a window to be closed and closing a window in `bevy_window`, and handle this in `bevy_winit`.

This is a stopgap until we move to windows as entites, which I'm sure I'll get around to eventually.

## Changelog

### Added

- `Window::close` to allow closing windows.
- `WindowClosed` to allow reacting to windows being closed.

### Changed

Replaced `bevy::system::exit_on_esc_system` with `bevy::window::close_on_esc`.

## Fixed

The app no longer exits when any window is closed. This difference is only observable when there are multiple windows. 

## Migration Guide

`bevy::input::system::exit_on_esc_system` has been removed. Use `bevy::window::close_on_esc` instead.
`CloseWindow` has been removed. Use `Window::close` instead.
The `Close` variant has been added to `WindowCommand`. Handle this by closing the relevant window.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

Fixes bevyengine#3180, builds from bevyengine#2898

## Solution

Support requesting a window to be closed and closing a window in `bevy_window`, and handle this in `bevy_winit`.

This is a stopgap until we move to windows as entites, which I'm sure I'll get around to eventually.

## Changelog

### Added

- `Window::close` to allow closing windows.
- `WindowClosed` to allow reacting to windows being closed.

### Changed

Replaced `bevy::system::exit_on_esc_system` with `bevy::window::close_on_esc`.

## Fixed

The app no longer exits when any window is closed. This difference is only observable when there are multiple windows. 

## Migration Guide

`bevy::input::system::exit_on_esc_system` has been removed. Use `bevy::window::close_on_esc` instead.
`CloseWindow` has been removed. Use `Window::close` instead.
The `Close` variant has been added to `WindowCommand`. Handle this by closing the relevant window.
Subserial pushed a commit to Subserial/bevy_winit_hook that referenced this pull request Jan 24, 2024
# Objective

Fixes #3180, builds from bevyengine/bevy#2898

## Solution

Support requesting a window to be closed and closing a window in `bevy_window`, and handle this in `bevy_winit`.

This is a stopgap until we move to windows as entites, which I'm sure I'll get around to eventually.

## Changelog

### Added

- `Window::close` to allow closing windows.
- `WindowClosed` to allow reacting to windows being closed.

### Changed

Replaced `bevy::system::exit_on_esc_system` with `bevy::window::close_on_esc`.

## Fixed

The app no longer exits when any window is closed. This difference is only observable when there are multiple windows. 

## Migration Guide

`bevy::input::system::exit_on_esc_system` has been removed. Use `bevy::window::close_on_esc` instead.
`CloseWindow` has been removed. Use `Window::close` instead.
The `Close` variant has been added to `WindowCommand`. Handle this by closing the relevant window.
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-Enhancement A new feature 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.

4 participants