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

[Catalina] Accessing many window methods crashes application #27

Closed
Fauntleroy opened this issue Dec 7, 2019 · 12 comments · Fixed by #31
Closed

[Catalina] Accessing many window methods crashes application #27

Fauntleroy opened this issue Dec 7, 2019 · 12 comments · Fixed by #31
Labels
bug Something isn't working help wanted Extra attention is needed platform/macos

Comments

@Fauntleroy
Copy link

When attempting to use methods like getBounds and setBounds on window objects acquired with windowManager.getWindows—or from new Window—the application crashes. I've been able to use these methods in the past on the window object returned by windowManager.getActiveWindow(). Is this some kind of permission or security issue?

I have an Electron Fiddle here: https://gist.github.com/Fauntleroy/84fde89e6ede40becffa1fe53132ab7b

Steps to reproduce:

  • Be in OSX Catalina (maybe just OSX?)
  • Load that fiddle
  • Use the interface to select an application
  • Set a start point (column, row) and an end point (column, row)
  • Press "up" to resize the window
  • The application should crash with an error dump
@sentialx sentialx added the bug Something isn't working label Dec 7, 2019
@sentialx
Copy link
Owner

Does it work for you on 1.3.0?

@Fauntleroy
Copy link
Author

@sentialx I'm not completely sure, but it would seem that the fiddle I posted now crashes on windowManager.getWindows();

@Fauntleroy
Copy link
Author

I'm sorry, but I feel like I was misunderstood: this module now crashes on windowManager.getWindows(), and I'm not even sure getBounds or setBounds work. Should I file a new issue for getWindows() causing a crash?

@sentialx sentialx reopened this Dec 12, 2019
@sentialx
Copy link
Owner

@Fauntleroy Does the example.js file work for you?

@Fauntleroy
Copy link
Author

It does not, it seems to crash on const window = windowManager.getActiveWindow();.

@sentialx
Copy link
Owner

@Fauntleroy Could you try adding windowManager.requestAccessibility() to the top? I forgot about it.

@Fauntleroy
Copy link
Author

I added it back to my test script. It either does nothing, or access has already been granted. In any case, the crashes still persist when trying to use just about any window method.

@sentialx
Copy link
Owner

What node-window-manager version do you use?

@Fauntleroy
Copy link
Author

Electron Fiddle always installs the latest version of the module, so 1.3.1:

image

@sentialx
Copy link
Owner

Okay, it seems it works for me because I don't have macOS Catalina. I'm curious what did they change so that it doesn't work...

@sentialx
Copy link
Owner

sentialx commented Dec 14, 2019

@Fauntleroy Fixed in 2.0.0, although the window.getTitle method will crash on macOS Catalina, because it needs some kind of desktop capturer permission (#32).

@Fauntleroy
Copy link
Author

@sentialx I can confirm that my test script is now working as expected! The loss of window.getTitle is regrettable, but my primary goal is working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed platform/macos
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants