Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

Recording widget: throttled like any hidden window while Yogurt is in front, so its clock, meter and preview stop working behind the main window

christianmat1d048640fe3f
diff --git a/app/src/main/widget.ts b/app/src/main/widget.ts
index c2f9a4fd..d85bb4b8 100644
--- a/app/src/main/widget.ts
+++ b/app/src/main/widget.ts
@@ -110,7 +110,11 @@ export function createWidget(d: { open(meetingId: string): void; stop(meetingId:
shown = view?.kind === 'recording' && !view.paused && !d.foreground()
if (!shown) { clearTimeout(pointerTimer); pressed = false; win?.webContents.send('widget:reset') }
hitTest(); poll()
- if (!win || win.isDestroyed() || BACKGROUND) return
+ if (!win || win.isDestroyed()) return
+ // hidden, it is throttled like any hidden window (its clock, meter and preview pause); floating over other apps it
+ // runs freely, which is why the window is made with throttling off
+ win.webContents.setBackgroundThrottling(!shown)
+ if (BACKGROUND) return
if (!shown) win.hide()
else if (sized && !win.isVisible()) win.showInactive()
}
diff --git a/app/test/widgetWindow.test.ts b/app/test/widgetWindow.test.ts
index ca632dec..d420d6ff 100644
--- a/app/test/widgetWindow.test.ts
+++ b/app/test/widgetWindow.test.ts
@@ -20,7 +20,7 @@ vi.mock('electron', () => ({
BrowserWindow: class {
static getAllWindows() { return state.windows }
bounds: any; options: any; dead = false
- webContents = { send: vi.fn(), once: (_name: string, fn: () => void) => fn() }
+ webContents = { send: vi.fn(), once: (_name: string, fn: () => void) => fn(), setBackgroundThrottling: vi.fn() }
constructor(options: any) { this.options = options; this.bounds = { x: options.x, y: options.y, width: options.width, height: options.height }; state.windows.push(this) }
getBounds() { return { ...this.bounds } }
setBounds(bounds: any) { this.bounds = bounds }
@@ -354,3 +354,19 @@ describe('finished meeting notifications', () => {
expect(state.notifications).toHaveLength(0)
})
})
+
+describe('hidden, the recorder does no work (the audit: its 4/s clock and meter kept running behind the main window)', () => {
+ it('is throttled like any hidden window while Yogurt is in front, and runs freely while it floats', async () => {
+ let front = true
+ const { createWidget } = await import('../src/main/widget')
+ const w = createWidget({ open, stop: vi.fn(), foreground: () => front })
+ state.start!({ id: 'meeting3', title: 'Review', startedAt: 0 })
+ const win3 = state.windows.at(-1)
+ send('widget:size', 127, 42)
+ w.visibilityChanged()
+ expect(win3.webContents.setBackgroundThrottling).toHaveBeenLastCalledWith(true)
+ front = false
+ w.visibilityChanged()
+ expect(win3.webContents.setBackgroundThrottling).toHaveBeenLastCalledWith(false)
+ })
+})