A native module that propagates click events to draggable areas in Electron on macOS. Forked to match electron version of hyper. (Forked from https://github.com/gerhardberger/electron-drag-click)
Find a file
2026-01-04 03:49:32 -05:00
.github/workflows fix ci 2024-11-03 09:12:14 +01:00
test fixes window dragging when window was not focused 2025-01-17 13:23:37 +01:00
.gitignore initial 2024-11-03 09:05:52 +01:00
.node-version Upgrade electron, bump to 2.0.0 2026-01-04 03:49:32 -05:00
binding.gyp initial 2024-11-03 09:05:52 +01:00
electron_drag_click.mm fixes window dragging when window was not focused 2025-01-17 13:23:37 +01:00
index.d.ts 1.0.6d 2025-04-22 17:42:29 -07:00
index.js fixes platform support 2024-11-09 20:46:58 +01:00
LICENSE initial 2024-11-03 09:05:52 +01:00
package-lock.json 1.0.6 2025-01-17 13:33:42 +01:00
package.json Upgrade electron, bump to 2.0.0 2026-01-04 03:49:32 -05:00
README.md initial 2024-11-03 09:05:52 +01:00
yarn.lock Upgrade electron, bump to 2.0.0 2026-01-04 03:49:32 -05:00

electron-drag-click

Description

$ npm i electron-drag-click

This Native Node Module allows you to change the behavior of how frameless Electron browser windows handle pointer events on macOS. Chromium's built-in mechanism ignores pointer events in draggable regions in frameless windows. This module changes the built-in hit testing so in frameless windows pointer events are propagated even in draggable regions.

It is based on my earlier PR in the Electron repository (https://github.com/electron/electron/pull/38208), which after some discussion with maintainers was decided not to be merged in, and rather be handled in a separate Native Module.

The code is using ObjectiveC's runtime method swizzling capability, which allows you to alter the implementation of an existing selector. Shoutout to @tzahola, who helped me dealing with these APIs.

Usage

const { app, BrowserWindow } = require('electron');
const electronDragClick = require('electron-drag-click');

electronDragClick();

app.on('ready', () => {
  const win = new BrowserWindow({
    width: 800,
    height: 600,
    frame: false,
  });

  win.loadFile('./index.html');
});