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

Alternative Windowing System #1329

Merged
merged 15 commits into from
Jun 20, 2023

Conversation

Wouter01
Copy link
Member

@Wouter01 Wouter01 commented Jun 18, 2023

Description

The current windowing system is great, but has some limitations. Due to the usage of NSWindow, we cannot fully use the SwiftUI focus system, which is important for the menubar (and possibly later the command palette). It also has some additional problems, such as:

  • Inspector resizing causing window glitches
  • Toolbar glitches when showing or hiding inspector

This PR adds an alternative way of handling windows. This fixes above issues and also brings:

  • Support for SwiftUI focus system
  • Better native window tab support
  • A proof of concept for the focus system: working menubar commands for terminal closing, tab history forward / backward, inspector and navigator visibility

Visually, no changes should be visible.

This window handling is experimental so it's put behind a feature flag. The feature flag can be set in settings and is disabled by default. Due to API limitations, the inspector is only visible on macOS Sonoma when the feature flag is enabled.

The feature flag will likely stay put until around the release of macOS Sonoma. Afterwards, we can review what solution would work best. If Apple fixes the focus api in NSWindow (FB12310769), it might be preferable to stick to the existing solution.

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Wouter01 added 8 commits June 17, 2023 17:05
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Wouter01 added 4 commits June 18, 2023 17:43
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Wouter01 and others added 2 commits June 19, 2023 21:01
Co-authored-by: Matthijs Eikelenboom <matthijs697@live.nl>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
@Wouter01 Wouter01 mentioned this pull request Jun 20, 2023
6 tasks
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
@Wouter01 Wouter01 merged commit 5c2a017 into CodeEditApp:main Jun 20, 2023
Copy link
Collaborator

@austincondiff austincondiff left a comment

Choose a reason for hiding this comment

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

Looks great! I might have a few questions about feature flags we may discuss on Discord later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants