Skip to content

improvement to window state - #1068

Merged
Wouter01 merged 5 commits into
CodeEditApp:mainfrom
Wouter01:windowstate-improvements
Feb 21, 2023
Merged

Wouter01 merged 5 commits into
CodeEditApp:mainfrom
Wouter01:windowstate-improvements

Conversation

@Wouter01

@Wouter01 Wouter01 commented Feb 20, 2023

Copy link
Copy Markdown
Member

Description

This PR adds a small but worthwile improvement to the app. Previously, if CodeEdit was quit and reopenend, documents would be reopened but without their previous window position (e.g. in fullscreen). By setting NSQuitAlwaysKeepsWindows to true, macOS will fix this for us automatically, and the window restoration will behave as if the app is force-quit each time (e.g. when you press the play button in Xcode).

Note: this doesn't cause any harm as there is no real 'force-quitting'

Oh, and it also removed the need for a swiftlint:disable comment. Yay!

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • I documented my code
  • Review requested

Screenshots

Previous: window position isn't kept on relaunch
https://user-images.githubusercontent.com/62355975/220004956-beddef2f-5a5b-4c7e-985e-be0a25081b8f.mov

New: window position is kept
https://user-images.githubusercontent.com/62355975/220005096-4151c696-3cd1-43e4-bf22-ddb836be9adc.mov

Signed-off-by: Wouter01 <wouterhennen@gmail.com>
@Wouter01 Wouter01 added the bug Something isn't working label Feb 20, 2023
@Wouter01 Wouter01 self-assigned this Feb 20, 2023
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
@Wouter01
Wouter01 enabled auto-merge (squash) February 20, 2023 03:52
Comment thread CodeEdit/AppDelegate.swift Outdated
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
austincondiff
austincondiff previously approved these changes Feb 20, 2023
Comment thread CodeEdit/AppDelegate.swift Outdated
0xWDG
0xWDG previously approved these changes Feb 20, 2023

@0xWDG 0xWDG left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please look at Matthijs's comments.

Signed-off-by: Wouter01 <wouterhennen@gmail.com>
austincondiff
austincondiff previously approved these changes Feb 21, 2023
@Wouter01
Wouter01 merged commit 32a2722 into CodeEditApp:main Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants