# Struct `kurogane::WindowClosing`

```rust
pub struct WindowClosing { /* private fields */ }
```

A window of the application's closing, passed to
[`App::on_window_closing`](https://kurogane-rs.org/docs/api/app/app.md#method.on_window_closing). It says which
window it is and where it was, to open it there again with
[`WindowOptions::placement`](https://kurogane-rs.org/docs/api/windows/windowoptions.md#method.placement).

[crate::App::on_window_closing]: https://kurogane-rs.org/docs/api/app/app.md#method.on_window_closing
[crate::WindowOptions::placement]: https://kurogane-rs.org/docs/api/windows/windowoptions.md#method.placement

## Methods

### `window`

```rust
pub fn window(&self) -> WindowId
```

The window
[`AppInstance::create_window`](https://kurogane-rs.org/docs/api/app/appinstance.md#method.create_window)
returned or the start window.

[crate::AppInstance::create_window]: https://kurogane-rs.org/docs/api/app/appinstance.md#method.create_window

### `name`

```rust
pub fn name(&self) -> Option<&str>
```

The name its options gave it
([`WindowOptions::name`](https://kurogane-rs.org/docs/api/windows/windowoptions.md#method.name)); none for a
window opened without one, as a page's is. The name is free from
this report on. A window opened now may take it.

[crate::WindowOptions::name]: https://kurogane-rs.org/docs/api/windows/windowoptions.md#method.name

### `placement`

```rust
pub fn placement(&self) -> WindowPlacement
```

Where the window was and how it showed. A window maximized,
minimized or fullscreen gives the place and size it restores to, not
the display it fills. The state is `Normal`, `Maximized` or
`Fullscreen`. A window minimized or never shown gives the state it
shows in once restored. The placement given back opens a window the
user sees.

Under xfwm4 a window the user maximized can give its maximized place
and size as `Normal` because xfwm4 sends a maximize's geometry before
its state.

## Trait implementations

- `impl Clone for WindowClosing`
- `impl Debug for WindowClosing`
- `impl Eq for WindowClosing`
- `impl PartialEq for WindowClosing`

Source: https://github.com/0x48piraj/kurogane/blob/584c586118ee53cc04604007ee038557bd859092/kurogane/src/window_closing.rs#L21
