Closed hsource closed 1 year ago
I pushed a new version so that it handles renames properly like the other OS's, and added a call to refocus the target after we call .show()
so that it doesn't take an extra click to focus the original app.
Will review it soon, a little busy these weeks.
Not familiar with Mac API, can you explain why addChildWindow won't work here?
Mac has a bit of a stricter permission model for windows - different applications don't have access to the NSWindow*
for other applications. Because of that, we just have to make do with what the Accessibility API lets us do.
This Stackoverflow question has more: addChild my window to other application's window
Depends on #20 , so that the behavior (always on top) is the same for all OS.
Depends on #20 , so that the behavior (always on top) is the same for all OS.
Right on time! I just rebased on top of that branch and it looks like really minimal changes are needed.
Tried to run https://github.com/hsource/electron-overlay-window/releases/tag/v3.0.0-macos.2 but no window appeared. Did allow iTerm.app to control computer.
❯ yarn demo:electron
yarn run v1.22.10
$ node-gyp build && yarn build-ts && electron dist/demo/electron-demo.js
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@16.8.0 | darwin | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Nothing to be done for `all'.
gyp info ok
$ tsc
(node:26592) electron: The default of nativeWindowOpen is deprecated and will be changing from false to true in Electron 15. See https://github.com/electron/electron/issues/28511 for more information.
(Use `Electron --trace-warnings ...` to show where the warning was created)
(node:26592) electron: The default of nativeWindowOpen is deprecated and will be changing from false to true in Electron 15. See https://github.com/electron/electron/issues/28511 for more information.
How can I get this working?
How can I get this working?
You just need to open a TextEdit window with an untitled document. It should automatically bind to that. I updated the instructions!
Works!
Hey! Will this ever be merged into master? Thanks!
any update?
Motivation
I wanted to get awakened_poe_trade working on Mac, and this was the biggest barrier, since no binaries existed for this on Mac.
PS: thanks a lot for the great demo app! I don't think developing this would've been possible without that
Fix
Created Mac interface for overlay_window.h - for the most part, this is structured similarly to the Windows/Linux code, with a few exceptions:
Side changes
Testing
Tested by:
yarn demo:electron
attachByTitle
in the electron-demo file to attach to a window with a different titleTested
Resizing, focusing
Fullscreen
https://user-images.githubusercontent.com/2937410/119969235-29ddc780-bf63-11eb-90d0-d80e57dbf5c5.mp4