Skip to content

Commit

Permalink
Do not emit Focused upon window creation
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Sep 11, 2024
1 parent 6aefe43 commit cd8a062
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/changelog/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ changelog entry.

To migrate, you can probably just replace all instances of `inner_size` with `surface_size` in your codebase.
- On macOS and iOS, no longer emit `ScaleFactorChanged` upon window creation.
- On macOS, no longer emit `Focused` upon window creation.

### Removed

Expand Down
3 changes: 3 additions & 0 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ pub enum WindowEvent {
/// The window gained or lost focus.
///
/// The parameter is true if the window has gained focus, and false if it has lost focus.
///
/// Windows are unfocused upon creation, but will usually be focused by the system soon
/// afterwards.
Focused(bool),

/// An event from the keyboard has been received.
Expand Down
4 changes: 0 additions & 4 deletions src/platform_impl/apple/appkit/window_delegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,10 +770,6 @@ impl WindowDelegate {

delegate.set_cursor(attrs.cursor);

// XXX Send `Focused(false)` right after creating the window delegate, so we won't
// obscure the real focused events on the startup.
delegate.queue_event(WindowEvent::Focused(false));

// Set fullscreen mode after we setup everything
delegate.set_fullscreen(attrs.fullscreen.map(Into::into));

Expand Down

0 comments on commit cd8a062

Please sign in to comment.