fix(electrobun): use setPosition+setSize instead of setFrame, add resize throttle

This commit is contained in:
Hibryda 2026-03-25 02:09:54 +01:00
parent cfb7dafa17
commit 48d32f6f28
2 changed files with 12 additions and 1 deletions

View file

@ -144,8 +144,13 @@
e.preventDefault();
e.stopPropagation();
}
let resizeThrottleId = 0;
function onResizeMove(e: MouseEvent) {
if (!isResizing || !resizeReady) return;
// Throttle to ~30fps to avoid overwhelming GTK
const now = Date.now();
if (now - resizeThrottleId < 33) return;
resizeThrottleId = now;
const dx = e.screenX - resizeStartX;
const dy = e.screenY - resizeStartY;
let { x, y, width, height } = resizeFrame;