Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Set focus on windows properly when showing.

Ilya8eb367187752
diff --git a/apps/desktop/src/components/windows/inner/Recorder.tsx b/apps/desktop/src/components/windows/inner/Recorder.tsx
index 45a2f5aa1..bf5c8d4a6 100644
--- a/apps/desktop/src/components/windows/inner/Recorder.tsx
+++ b/apps/desktop/src/components/windows/inner/Recorder.tsx
@@ -141,6 +141,7 @@ export const Recorder = () => {
tauriWindow.then(({ getAllWindows }) =>
getAllWindows().forEach((window) => {
window.show();
+ window.setFocus();
})
);
});
diff --git a/apps/desktop/src/utils/tray.ts b/apps/desktop/src/utils/tray.ts
index e359c2492..3d52dde66 100644
--- a/apps/desktop/src/utils/tray.ts
+++ b/apps/desktop/src/utils/tray.ts
@@ -81,7 +81,9 @@ export const setTrayMenu = async (
await MenuItem.new({
text: "Show",
action: () => {
- Window.getCurrent()?.show();
+ const window = Window.getCurrent();
+ window.show();
+ window.setFocus();
},
}),
await PredefinedMenuItem.new({