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

"unresponsive" event is incorrectly fired when calling synchronous version of dialog methods #6146

Closed
astoilkov opened this issue Jun 20, 2016 · 13 comments
Labels
beginner friendly bug 🪲 bug/regression ↩️ A new version of Electron broke something

Comments

@astoilkov
Copy link
Contributor

astoilkov commented Jun 20, 2016

  • Electron version: 1.2.1
  • Operating system: OS X 10.9.5
    1. Subscribe to the BrowserWindow "unresponsive" event (and add a debugger)
    2. Call the synchronous version of dialog. showOpenDialog() method
    3. Wait enough time and the debugger in the unresponsive event will be called

I understand why this happens. However, can something be done for this case? I hope you guys could fix it or maybe just provide an API for dialog.hasOpenDialog so this behavior could be fixed in our code.

@astoilkov astoilkov changed the title "unresponsive" event is incorrectly when calling synchronous version of dialog methods "unresponsive" event is incorrectly called when calling synchronous version of dialog methods Jun 20, 2016
@astoilkov astoilkov changed the title "unresponsive" event is incorrectly called when calling synchronous version of dialog methods "unresponsive" event is incorrectly called when calling synchronous version of dialog methods are executed Jun 20, 2016
@astoilkov astoilkov changed the title "unresponsive" event is incorrectly called when calling synchronous version of dialog methods are executed "unresponsive" event is incorrectly called when calling synchronous version of dialog methods Jun 20, 2016
@astoilkov astoilkov changed the title "unresponsive" event is incorrectly called when calling synchronous version of dialog methods "unresponsive" event is incorrectly fired when calling synchronous version of dialog methods Jun 20, 2016
@zcbenz zcbenz added the blocked/need-info ❌ Cannot proceed without more information label Jun 21, 2016
@zcbenz
Copy link
Member

zcbenz commented Jun 21, 2016

How did you call the API? I think we have solved this before, we probably missed some cases.

@astoilkov
Copy link
Contributor Author

astoilkov commented Jun 21, 2016

Pasted the code we use below. Note that I have to wait 2-3 minutes before the unresponsive event is called. I also tested this behavior on newer operating system and the behavior was the same.

dialog.showOpenDialog({
  title: 'Open File',
  properties: ['openFile']
});

P.S. I could also test under Windows and Linux if you want.

@zcbenz
Copy link
Member

zcbenz commented Jun 21, 2016

Are you running the code in the main process? If so this would be quite surprising to me, the code is blocking the whole main process and there is no chance for unresponsive event to emit. A minimal app that can reproduce it would be very helpful here.

@astoilkov
Copy link
Contributor Author

I call the dialog.showOpenDialog() method in the renderer process. Is this the problem?

@zcbenz
Copy link
Member

zcbenz commented Jun 22, 2016

Hmm I'm unable to reproduce by calling it in renderer process.

@astoilkov
Copy link
Contributor Author

Ok. I will create a simple app that reproduces the issue.

@astoilkov
Copy link
Contributor Author

Sorry for the delay but I will have to do it next week.

@astoilkov
Copy link
Contributor Author

Hi,

I have created a simple app that replicates the issue. Steps to reproduce:

  1. Open the app
  2. Hit "s" character on the keyboard
  3. The dialog will appear
  4. Wait for 2-3 minutes
  5. The unresponsive event is called and and a message box will appear

electron-dialog-unresponsive.zip

@zcbenz
Copy link
Member

zcbenz commented Jul 1, 2016

Hmm I can not reproduce with your app, it is probably because I'm using OS X 10.11.

@zcbenz
Copy link
Member

zcbenz commented Jul 1, 2016

Currently we only suppress unresponsive event when a dialog is attached to a window, which might be why it is happening for some systems. We should probably just suppress the unresponsive event for all windows as long as there is dialog showing.

@zcbenz zcbenz added bug and removed blocked/need-info ❌ Cannot proceed without more information labels Jul 1, 2016
@astoilkov
Copy link
Contributor Author

I agree.

P.S. I have also tested the sample under OS X 10.11.5 and successfully replicated the problem. After I open the dialog I wait and don't do anything else (maybe this is also related).

@zcbenz
Copy link
Member

zcbenz commented Jun 14, 2017

Reopening since it reappears in v1.6.x.

@codebytere
Copy link
Member

Left this up for 10 minutes on the latest master and could not reproduce, so i'm going to close this out! feel free to @ me for a reopen if it crops up again 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner friendly bug 🪲 bug/regression ↩️ A new version of Electron broke something
Projects
None yet
Development

No branches or pull requests

4 participants