Fix unsolicited radial menu activation by retiring global drag detection

This commit is contained in:
nordik committed 2026-10-27 12:13:15 +01:00
1 parent 569f0324d6
commit e3c9581f3e
19 files changed
+112 -88

No files matched your search

+1 -4
View File
@@ -2,7 +2,7 @@ const { spawn } = require('node:child_process');
const path = require('node:path');
class WindowsBridge {
constructor(root) {
this.next = 1; this.pending = new Map(); this.onDrag = () => {};
this.next = 1; this.pending = new Map();
this.process = spawn(path.join(root, 'vendor/windows/FileBow.Windows.exe'), [], { windowsHide: true, stdio: ['pipe','pipe','pipe'] });
let buffer = '';
this.ready = new Promise((resolve, reject) => {
@@ -14,7 +14,6 @@ class WindowsBridge {
for (const line of lines) {
let message; try { message = JSON.parse(line); } catch { continue; }
if (message.type === 'ready') resolve();
else if (message.type === 'drag') this.onDrag(message);
else if (this.pending.has(message.id)) {
const pending = this.pending.get(message.id); this.pending.delete(message.id); clearTimeout(pending.timer);
if (message.error) pending.reject(new Error(message.error)); else pending.resolve(message.result);
@@ -39,8 +38,6 @@ class WindowsBridge {
});
}
getExplorerSelection() { return this.request('selection'); }
startFileDragMonitor(callback) { this.onDrag = callback; return this.request('monitor', { enabled: true }); }
stopFileDragMonitor() { return this.request('monitor', { enabled: false }); }
close() { this.process.stdin.end(); }
}
module.exports = { WindowsBridge };