Skip to content

Exit dialog window - #9652

Open
TheProjectDark wants to merge 6 commits into
apache:masterfrom
TheProjectDark:master
Open

TheProjectDark wants to merge 6 commits into
apache:masterfrom
TheProjectDark:master

Conversation

@TheProjectDark

@TheProjectDark TheProjectDark commented Oct 2, 2026 •

Copy link
Copy Markdown

Description

I was reviewing code in NetBeans and often miss-clicked cmd+q instead of pressing cmd+a, and it was so annoying to wait until the IDE re-launches so I just implemented exit dialog window like in Firefox or JetBrains.

Implementation

The exit flow is centralized in ExitDialog.showDialog(), which is already called during shutdown. It checks for open unsaved files first: if there are any, NetBeans shows its existing save/discard dialog. If there are none, it checks the new preference and, when enabled, shows Exit, Save All and Exit, and Cancel. Choosing Save All calls LifecycleManager.saveAll() before allowing shutdown; Cancel keeps the IDE open.
The checkbox is in Tools > Options > General. The panel loads its value when the options page opens, detects changes so Apply is enabled when appropriate, and saves the preference when settings are applied. The preference is stored with NetBeans’ user settings and defaults to enabled. Cmd+Q and Ctrl+F4 reach the same shutdown flow through their respective platform handlers/keymap bindings.

Screenshots

Screenshot 2026-10-01 at 14 08 34 Screenshot 2026-10-01 at 14 08 14

Assisted by: GitHub Copilot to navigate through project's structure


^Add meaningful description above

Click to collapse/expand PR instructions

By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -

  • are all your own work, and you have the right to contribute them.
  • are contributed solely under the terms and conditions of the Apache License 2.0 (see section 5 of the license for more information).

LLMs, Commit messages and PR description:

  • Please make sure (eg. git log) that all commits have a valid name and email address for you in the Author field.
  • LLM assisted commits should be attributed with an Assisted-by: MODEL_NAME MODEL_VERSION line appended to the commit message.
    • Please mention coding assistance in the PR description too (eg. by adding the same Assisted-by line from above)
    • Please describe the changes in your own words - we'd like to know you understand the changes being made!

If you're a first time contributor, see the Contributing guidelines for more information.

If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.

PR approval and merge checklist:

  1. Was this PR correctly labeled, did the right tests run? When did they run?
  2. Is this PR squashed?
  3. Are author name / email address correct? Are co-authors correctly listed? Do the commit messages need updates?
  4. Does the PR title and description still fit after the Nth iteration? Is the description sufficient to appear in the release notes?

If this PR targets the delivery branch: don't merge. (full wiki article)

@neilcsmith-net neilcsmith-net left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for looking at this. I hit this issue sometimes with a dual monitor setup when the close icon is right next to something I'm trying to click on the other screen! 😄

Couple of changes that are not related need looking at, and I'm not sure why we need the Save All option?

Comment thread ide/defaults/src/org/netbeans/modules/defaults/mf-layer-eclipse-keybinding.xml Outdated
Comment thread ide/defaults/src/org/netbeans/modules/defaults/mf-layer.xml Outdated
Comment thread platform/o.n.core/src/org/netbeans/core/ExitDialog.java Outdated
@neilcsmith-net neilcsmith-net added the UI User Interface label Oct 2, 2026
Comment thread platform/o.n.core/src/org/netbeans/core/Bundle.properties Outdated
@TheProjectDark

Copy link
Copy Markdown
Author
Screenshot 2026-10-02 at 13 44 44

So far I implemented the requested changes

@mbien mbien added the ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) label Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) UI User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants