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

Modality #2

Open
miho opened this issue Oct 16, 2017 · 7 comments
Open

Modality #2

miho opened this issue Oct 16, 2017 · 7 comments

Comments

@miho
Copy link

miho commented Oct 16, 2017

Hi there, I tried somethings similar in the past but I was missing modality support. Any ideas on how to achieve this?

@steffen678
Copy link
Owner

Unfortunately no. Nothing I have tried so far worked. I'm aware that the parent window is still clickable (despite being entirely white). I also asked on Stackoverflow about this more than two years ago.

@miho
Copy link
Author

miho commented Oct 16, 2017

Hmm, that is bad. For my use case modality cannot be optional. I use it for a fairly complex application (VRL-Studio) which crashes if I use JavaFX dialogs and violate modality. I will let you know if I found a solution.

@timobaumann
Copy link

not quite modal but the commented lines (126 & 137) help a lot if uncommented: people can still loose the filedialog behind other windows but they at least cannot click anything in the calling application.
However, just uncommenting them will lead to NPEs if showOpenDialog is called with the null component. This can be fixed by only changing the enable status if parent != null.
This works like a charm for me; I'll be happy to provide a patch or pull request (although it's just two lines to be fixed)

@steffen678
Copy link
Owner

steffen678 commented Mar 29, 2018

I previously had the issue that those lines would cause the parent window to minimize upon choosing a file. That's why they are uncommented, if I remember correctly.

edit: Okay, I just tested it and it doesn't seem to be happening anymore. For me, at least.

@timobaumann
Copy link

it didn't happen for me either (linux/GTK), so I'm leaving it in. The alternative was much more disturbing: actions in the parent window would not yield any responses while the filedialog is shown but all be executed after the filedialog is dismissed. I think the potential for confusion is even larger than minimization in that case.

@steffen678
Copy link
Owner

I published a new version which enables this behaviour by default. Still unsure about “real” modality, but better than nothing, I guess.

@timobaumann
Copy link

thank you so much!

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

No branches or pull requests

3 participants