Search code examples
javascriptelectrondwm

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.

Solution

  • 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.