如何启用windows与无框电子window对接

How to enable windows docking with frameless electron window

所以 electron 有一个功能,你可以在 'frame' 选项设置为 false 的情况下使 BrowserWindow 无框架。从 1.4.14 版开始,停靠(使用 windows 键 + left/right)或拖动 window(并最大化)不再有效。

我找不到电子版本的任何 API 更改或文档中关于此功能的任何特定内容。

我正在从 electron 1.4.4 升级到 1.7.10。

重现:https://github.com/PerfectionCSGO/electron-dwm-issue

# Clone this repository
git clone https://github.com/PerfectionCSGO/electron-dwm-issue
# Go into the repository
cd electron-quick-start
# Install dependencies
npm install
# Run the app
npm start
# Change the values around of setResizable and resizable to fiddle with the behavior.

如果您最初将 resizable 设置为 false,然后设置 resize(true),确定您可以调整大小,那么 windows 中的停靠功能将被破坏。 我在这里做了一个问题来跟踪这个问题:https://github.com/electron/electron/issues/11568

我的解决方案是允许用户始终调整大小以支持破坏对接功能。

此外,原始问题已被编辑为具有可重现的问题。