Winterreisender / webview-nodejs

A Node.js binding to webview
Apache License 2.0
89 stars 10 forks source link

how to set postion of the window? #15

Closed anhnhoktvn closed 1 year ago

anhnhoktvn commented 1 year ago

Is there a way to change the position of the window. For example, I'd like to make it in the center of the screen. Thank you!

Winterreisender commented 1 year ago

Thanks for your feedback. But unfortunately our upstream project, webview, does not support this feature, so we can't do that. This repo is only a Node.js binding for webview. If you need new features, you could send you feedback to webview. I would be happy to try making API bindings after webview adding them.

Winterreisender commented 1 year ago

You may see this feature request in webview: https://github.com/webview/webview/issues/642, in which it mentioned a method to center the window using C++. webview-nodejs support setting the target window handle. So if you can create a centered window, and pass the handle to webview-nodejs by using target parameter in new Webview(debug?: boolean, libPath?: string, target?: null), it may work.

anhnhoktvn commented 1 year ago

Thank you, It's seem nothing I can do with this. I may try workaround with xdotool