sentialx / node-window-manager

Manage windows in Windows, macOS and Linux using Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Catalina] Accessing many window methods crashes application

Fauntleroy opened this issue · comments

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

Does it work for you on 1.3.0?

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

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?

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

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

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

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.

What node-window-manager version do you use?

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

image

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...

@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).

@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!