diff --git a/main.js b/main.js index 225d2a7..85fe4a4 100644 --- a/main.js +++ b/main.js @@ -186,6 +186,9 @@ app.on('ready', () => { case 'hide': mainWindow.hide() break; + case 'show': + mainWindow.show() + break; } }); // 导出是否全屏 diff --git a/src/components/Operation/index.tsx b/src/components/Operation/index.tsx index 2ebc3dd..7f7ba5d 100644 --- a/src/components/Operation/index.tsx +++ b/src/components/Operation/index.tsx @@ -1,7 +1,7 @@ import styles from '@/components/Operation/index.module.scss' import ImageUrl from '@/utils/package/imageUrl'; import { useEffect, useState } from "react"; -type OperationKeyType = 'minimize' | 'quit' | 'maximize' | 'unmaximize' | 'hide'; +type OperationKeyType = 'minimize' | 'quit' | 'maximize' | 'unmaximize' | 'hide' | 'show'; type OperationType = { icon: string; key: OperationKeyType; diff --git a/src/components/QuitTips/index.tsx b/src/components/QuitTips/index.tsx index 4eaecdd..6e0e8d1 100644 --- a/src/components/QuitTips/index.tsx +++ b/src/components/QuitTips/index.tsx @@ -3,7 +3,7 @@ import { storage } from '@/utils'; import { InfoCircleOutlined } from '@ant-design/icons'; import { Button, Checkbox, Modal, Radio } from 'antd'; import { useState, useImperativeHandle, forwardRef } from "react"; -type OperationKeyType = 'minimize' | 'quit' | 'maximize' | 'unmaximize' | 'hide'; +type OperationKeyType = 'minimize' | 'quit' | 'maximize' | 'unmaximize' | 'hide' | 'show'; const QuitTips = forwardRef((props: any, ref: any) => { useImperativeHandle(ref, () => ({ changeModal: () => { diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 00768c9..7295162 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -1486,6 +1486,7 @@ const Meeting: React.FC = () => { await allUserLook(user.screenShareId, user.userName) const isOpen = await getKeyOpenChildWindow('shareScreenWindow') setIsScreenCapture(true) + window.electron.setViewStatus('hide') if (!isOpen) { window.electron.createChildWindow({ url: location.origin + `/#/shareScreenWindow`, @@ -1553,20 +1554,23 @@ const Meeting: React.FC = () => { setFooterList(footerListTemplate) window.electron.closeChildWindow('shareScreenWindow') setKeyOpenChildWindow('shareScreenWindow', false) - if (isScreenCapture) { - setIsScreenCapture(false) - window.electron.getWindowSize().then((res: any) => { - window.electron.setMainWindowSize({ - width: Math.ceil(res.width / 1.5), - height: Math.ceil(res.height / 1.3), + setIsScreenCapture(bool => { + if (bool) { + window.electron.setViewStatus('show') + window.electron.getWindowSize().then((res: any) => { + window.electron.setMainWindowSize({ + width: Math.ceil(res.width / 1.5), + height: Math.ceil(res.height / 1.3), + }) + window.electron.getIsMaximized().then((b: boolean) => { + if (!b) { + window.electron.setViewStatus('maximize') + } + }) }) - window.electron.getIsMaximized().then((b: boolean) => { - if (!b) { - window.electron.setViewStatus('maximize') - } - }) - }) - } + } + return false + }) } // 获取房间用户 const getRoomUser = async (): Promise => { diff --git a/src/render.d.ts b/src/render.d.ts index 333ce68..7c85640 100644 --- a/src/render.d.ts +++ b/src/render.d.ts @@ -2,7 +2,7 @@ export interface IElectronAPI { setMainWindowSize: (config: any) => void; getWindowSize: () => any; - setViewStatus: (status: 'quit' | 'maximize' | 'minimize' | 'unmaximize' | 'hide') => void; + setViewStatus: (status: 'quit' | 'maximize' | 'minimize' | 'unmaximize' | 'hide' | 'show') => void; getIsMaximized: () => Promise; setWriteText: (text: string) => void; onQuit: (callBack: Function) => void;