node-window-manager icon indicating copy to clipboard operation
node-window-manager copied to clipboard

`window.getTitle` doesn't work on macOS Catalina

Open sentialx opened this issue 5 years ago • 6 comments

Bug description window.getTitle method doesn't work on macOS Catalina, because now it requires some desktop capturer permissions.

Details:

  • Operating System: macOS Catalina
  • node-window-manager version: 2.0.0
  • Last known working node-window-manager version: none

sentialx avatar Dec 14 '19 18:12 sentialx

As a workaround, request permission using https://github.com/karaggeorge/mac-screen-capture-permissions first.

prodrammer avatar Jan 30 '20 12:01 prodrammer

@sentialx still I am facing this issue with my electron app on MAC.

aniyd avatar Jul 21 '20 12:07 aniyd

BTW, PR #51 fixed a segmentation fault, but now getTitle() does not return the window title anymore, but instead the Application name.

mattallty avatar Aug 02 '20 09:08 mattallty

@mattallty I can confirm that window.getTitle is not working as expected in v2.2.4. Using macOS Big Sur. I'm sticking to v2.2.3 because of it.

desko27 avatar Jan 30 '21 23:01 desko27

BTW, PR #51 fixed a segmentation fault, but now getTitle() does not return the window title anymore, but instead the Application name.

try to change file macos.mm NSString *windowName = wInfo[(id)kCGWindowOwnerName]; to NSString *windowName = wInfo[(id)kCGWindowName]; after that recompile it.

DYGidin avatar Apr 15 '21 09:04 DYGidin

@DYGidin This was exactly what I needed. In dev, I had to manually grant permissions to VSCode, but it's working excellently after applying that change. Thanks!

stephancasas avatar Sep 06 '21 02:09 stephancasas