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

Use NSApp.keyWindow Over Global keyWindow #1819

Merged

Conversation

thecoolwinter
Copy link
Collaborator

Description

In the current build, using command-W throws an exception. This fixes that by swapping out the use of the global keyWindow with NSApp.keyWindow.

This error appears to have appeared recently, but the global keyWindow should never have been used in the first place. It may have been the case that the use of this variable was previously linked to a different, similarly named, one by the compiler. But it now points to this header.

I've also added UI tests for all windows for the command-w command, and the command-shift-w command in workspaces.

Related Issues

  • None opened yet.

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

@thecoolwinter thecoolwinter marked this pull request as ready for review July 22, 2024 05:32
@thecoolwinter thecoolwinter added bug Something isn't working P1 This is a high-priority issue labels Jul 22, 2024
@matthijseikelenboom matthijseikelenboom merged commit 8818cdf into CodeEditApp:main Jul 22, 2024
2 checks passed
@thecoolwinter thecoolwinter deleted the fix/window-close branch July 22, 2024 13:59
@plbstl
Copy link
Contributor

plbstl commented Jul 23, 2024

Insane. This also helped with a bug when working on #1820. After interacting with a preview, pressing cmd+w does nothing, pressing the keybinding again throws an exception.

#1796. This fix also doesn't let cmd w close the 'Open Quickly' and 'Quick Actions' modals. Although, the selected tab still closes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 This is a high-priority issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants