@tobq/boardclip 2.1.112 → 2.1.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.js +18 -4
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -4467,10 +4467,10 @@ function createPopup() {
|
|
|
4467
4467
|
setTimeout(() => {
|
|
4468
4468
|
if (Date.now() < ignoreBlurUntil || !isPopupOpen()) return;
|
|
4469
4469
|
if (!win.isFocused()) {
|
|
4470
|
-
// Focus moved to one of BoardClip's OWN windows
|
|
4471
|
-
//
|
|
4472
|
-
//
|
|
4473
|
-
// (getFocusedWindow() is null then)
|
|
4470
|
+
// Focus moved to one of BoardClip's OWN windows: a clip window's own
|
|
4471
|
+
// focus hook (trackClipWindow) closes the popup; any other (the AI
|
|
4472
|
+
// approval prompt) leaves it open. Focus leaving to another app
|
|
4473
|
+
// (getFocusedWindow() is null then) closes it here.
|
|
4474
4474
|
const focused = BrowserWindow.getFocusedWindow();
|
|
4475
4475
|
if (focused && focused !== win) return;
|
|
4476
4476
|
hidePopup();
|
|
@@ -5405,9 +5405,20 @@ function restoreWindowMaximized(childWin, key, options) {
|
|
|
5405
5405
|
// (lib/window-placement.js). The work area is the popup's display, else the
|
|
5406
5406
|
// saved spot's, else the cursor's.
|
|
5407
5407
|
const clipWindows = new Set();
|
|
5408
|
+
// Going INTO a clip window (clicking it, or any other way it takes the focus)
|
|
5409
|
+
// closes the popup, on every platform: the "open several" gestures leave the
|
|
5410
|
+
// popup up only while the new windows open behind the scenes (showInactive).
|
|
5411
|
+
// Owner 2026-10-13: "still doesnt close going to clip. inconsisnte" - the
|
|
5412
|
+
// popup's blur handler kept it open whenever the focus went to one of our own
|
|
5413
|
+
// windows, and macOS has no blur-to-hide at all.
|
|
5414
|
+
let clipFocusHideHeldUntil = 0;
|
|
5408
5415
|
function trackClipWindow(childWin) {
|
|
5409
5416
|
clipWindows.add(childWin);
|
|
5410
5417
|
try { placedBounds.set(childWin, childWin.getBounds()); } catch {}
|
|
5418
|
+
childWin.on('focus', () => {
|
|
5419
|
+
if (Date.now() < clipFocusHideHeldUntil || !isPopupOpen()) return;
|
|
5420
|
+
hidePopup();
|
|
5421
|
+
});
|
|
5411
5422
|
childWin.once('closed', () => clipWindows.delete(childWin));
|
|
5412
5423
|
}
|
|
5413
5424
|
function clipWindowBoundsFromSettings(key, defaults, options) {
|
|
@@ -5525,6 +5536,9 @@ function sourceGroupsForNewNote(options) {
|
|
|
5525
5536
|
function presentSecondaryWindow(targetWin, options = {}) {
|
|
5526
5537
|
if (!targetWin || targetWin.isDestroyed()) return;
|
|
5527
5538
|
if (options && options.keepPopup) {
|
|
5539
|
+
// Backstop: a focus event the inactive show raises on its own must not
|
|
5540
|
+
// close the popup the user is still opening clips from.
|
|
5541
|
+
clipFocusHideHeldUntil = Date.now() + 300;
|
|
5528
5542
|
targetWin.showInactive();
|
|
5529
5543
|
if (typeof targetWin.moveTop === 'function') { try { targetWin.moveTop(); } catch {} }
|
|
5530
5544
|
return;
|
package/package.json
CHANGED