electron icon indicating copy to clipboard operation
electron copied to clipboard

[Bug]: Render process does not catch pointer events properly in frameless mode within -webkit-app-region: drag; element

Open kashamalasha opened this issue 2 years ago • 2 comments

Preflight Checklist

Electron Version

24.2.0

What operating system are you using?

macOS

Operating System Version

Ventura 13.2

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

22.3.8

Expected Behavior

Steps to Reproduce:

Set BrowserWindow property "frame" to "false". Set "-webkit-app-region: drag" on the body of an HTML file. Try to catch UIEvents "pointerdown" and "pointerup" on any elements within the draggable parent.

Expected result: The app should catch and handle the "pointerdown" and "pointerup" events.

Actual Behavior

Actual Result: The app does not catch the "pointerdown" events as expected. Instead, it catches a two-finger "pointerdown" event only. Additionally, "pointerup" events are not caught at all.

Workaround: Add explicitly property -webkit-app-region: no-drag; to the elements that need to be listened to. But in version 22.3.8 it was possible to hook the event.shiftKey event and leave the whole window dragged on a normal click, and be able to listen to UI events when the Shift key was pressed.

Testcase Gist URL

https://gist.github.com/99fc6e7521a7e3e44d6110b49c0dd061

Additional Information

This bug was not present in the previous work version of Electron (22.3.8).

kashamalasha avatar May 05 '23 10:05 kashamalasha

It has the same behavior in 23.0.0 release as well.

kashamalasha avatar May 05 '23 12:05 kashamalasha

Duplicate of #37789, which in turn is probably a duplicate of like a dozen identical issues. This is probably one of the most submitted issues. Primarily because of how annoying it is.

BlobTheKat avatar May 05 '23 14:05 BlobTheKat

Closing as duplicate of https://github.com/electron/electron/issues/37789

codebytere avatar May 08 '23 19:05 codebytere