mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-06-17 03:13:30 -07:00
fix(overlay): restore macOS Yomitan popup focus without breaking click-away (#125)
This commit is contained in:
@@ -5307,6 +5307,15 @@ const { registerIpcRuntimeHandlers } = composeIpcRuntimeHandlers({
|
||||
focusMainWindow: () => {
|
||||
const mainWindow = overlayManager.getMainWindow();
|
||||
if (!mainWindow || mainWindow.isDestroyed()) return;
|
||||
if (process.platform === 'darwin') {
|
||||
focusMacOSOverlayWindow({
|
||||
platform: process.platform,
|
||||
getOverlayWindow: () => mainWindow,
|
||||
stealAppFocus: () => app.focus({ steal: true }),
|
||||
warn: (message, details) => logger.warn(message, details),
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!mainWindow.isFocused()) {
|
||||
mainWindow.focus();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user