fix(electrobun): skip window drag when click is within 8px resize border zone

This commit is contained in:
Hibryda 2026-03-25 18:54:51 +01:00
parent a814e39410
commit 94a8e4072d

View file

@ -95,6 +95,9 @@
function onDragStart(e: MouseEvent) {
const target = e.target as HTMLElement;
if (target.tagName === 'BUTTON' || target.tagName === 'INPUT' || target.closest('button') || target.closest('.rz')) return;
// Don't drag if click is within the resize border zone (8px from any edge)
const B = 8;
if (e.clientX < B || e.clientY < B || e.clientX > window.innerWidth - B || e.clientY > window.innerHeight - B) return;
// Delegate to GTK — the WM handles everything (smooth, zero CPU)
appRpc.request['window.beginMove']({
button: e.button + 1, // DOM: 0=left, GTK: 1=left