Fix modal dialogs freezing all IDE windows (#1375)#1437
Open
deekshithaby wants to merge 1 commit intoprocessing:mainfrom
Open
Fix modal dialogs freezing all IDE windows (#1375)#1437deekshithaby wants to merge 1 commit intoprocessing:mainfrom
deekshithaby wants to merge 1 commit intoprocessing:mainfrom
Conversation
- Change FileDialog modality from APPLICATION_MODAL to DOCUMENT_MODAL in Base.java, Sketch.java, and ShimAWT.java so file dialogs only block their parent window on Linux/Windows. - Replace orphan Frame() parents in Messages.kt with a helper that uses KeyboardFocusManager to find the active window and creates DOCUMENT_MODAL dialogs, preventing message popups from freezing all IDE windows. Note: Native macOS file dialogs ignore Java modality settings (Apple limitation), but all JOptionPane-based messages are now fixed across all platforms.
Collaborator
|
Awesome, thanks for finding this and fixing. will review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a modal message appears (error, warning, "Save first", etc.), it freezes ALL Processing IDE windows. Users can't interact with any other window, and the modal can get lost behind other windows with no way to recover.
Root Cause
Messages.kt: All popup dialogs usedFrame()as their parent (an orphan frame with no connection to any editor window), causingAPPLICATION_MODALbehaviour that blocks every window.Base.java,Sketch.java,ShimAWT.java:FileDialoginstances did not set modality type, defaulting toAPPLICATION_MODAL.Fix
-Messages.kt: Created a
showModalDialog()helper that finds the currently active window viaKeyboardFocusManagerand createsDOCUMENT_MODALdialogs. Replaced all 5JOptionPane.showMessageDialog(Frame(), ...)calls with this helper.DOCUMENT_MODALon allFileDialoginstances in Base.java, Sketch.java, and ShimAWT.java.Result
DOCUMENT_MODALon Linux/Windows. Native macOS file dialogs ignore Java modality settings (Apple limitation), but all JOptionPane-based messages are fixed across all platforms.Testing
Fixes #1375