简体   繁体   中英

How to enable windows docking with frameless electron window

So electron has a feature where you can make a BrowserWindow frameless with 'frame' option set to false. From version 1.4.14 and onwards, docking (with windows key + left/right) or dragging the window (and maximizing) does not work anymore.

I can't find any API changes in the electron releases or anything specific in the documentation regarding this feature.

I'm upgrading from electron 1.4.4 to 1.7.10.

To reproduce: 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.

If you've set resizable to false initially and then setResize(true), sure you can resize, then the docking feature in windows will be broken. I've made an issue here to track the issue: https://github.com/electron/electron/issues/11568

My solution is to allow the user to always resize in favor of breaking the docking functionality.

Also the original question has been edited to have a reproducable issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM