Skip to content

macOS: Emit resize on frame_did_change#2239

Merged
kchibisov merged 1 commit intorust-windowing:masterfrom
sshock:plh/emit-resize-on-frame-did-change
May 23, 2022
Merged

macOS: Emit resize on frame_did_change#2239
kchibisov merged 1 commit intorust-windowing:masterfrom
sshock:plh/emit-resize-on-frame-did-change

Conversation

@sshock
Copy link
Contributor

@sshock sshock commented Apr 4, 2022

  • Tested on all platforms changed
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • (n/a) Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • (n/a) Created or updated an example program if it would help users understand this functionality
  • (n/a) Updated feature matrix, if new features were added or implemented

For testing:

  • First make sure "Prefer tabs" is set to "always" in macOS system preferences
    • (so new windows will get grouped as tabs).
  • Add a debug statements such as println!("emitting resize event with size = {:?}", size);
    • Add to emit_resize_event method in src/platform_impl/macos/window_delegate.rs.
    • Add to frame_did_change method in src/platform_impl/macos/view.rs. (next to new code)
  • Run the multiwindow example program.
    • Each time you hit a key to create a new window, note that the last resize event emitted has the correct size.

@sshock sshock changed the title Emit resize on frame did change Emit resize on frame_did_change Apr 4, 2022
Copy link
Member

@kchibisov kchibisov left a comment

Choose a reason for hiding this comment

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

You should also add a changelog entry for that change.

@kchibisov kchibisov requested a review from madsmtm April 4, 2022 06:27
@kchibisov kchibisov added the DS - appkit Affects the AppKit/macOS backend label Apr 4, 2022
@sshock
Copy link
Contributor Author

sshock commented Apr 4, 2022

You should also add a changelog entry for that change.

Done!

@sshock sshock requested a review from kchibisov April 4, 2022 07:28
@sshock sshock changed the title Emit resize on frame_did_change macOS: Emit resize on frame_did_change Apr 4, 2022
@kchibisov kchibisov added this to the Version 0.27 milestone Apr 11, 2022
When the window switches mode from normal to tabbed one, it doesn't
get resized, however the frame gets resized. This commit makes
winit to track resizes when frame changes instead of window.

Fixes rust-windowing#2191.
@kchibisov kchibisov force-pushed the plh/emit-resize-on-frame-did-change branch from 457e50d to b3ac938 Compare May 23, 2022 19:38
@kchibisov kchibisov merged commit bcd76d4 into rust-windowing:master May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DS - appkit Affects the AppKit/macOS backend

Development

Successfully merging this pull request may close these issues.

On macOS the frame size could change without window resize

2 participants