This commit is contained in:
yj 2024-10-15 17:33:18 +08:00
parent 225a8c8e71
commit 444568b232
5 changed files with 23 additions and 16 deletions

View File

@ -186,6 +186,9 @@ app.on('ready', () => {
case 'hide':
mainWindow.hide()
break;
case 'show':
mainWindow.show()
break;
}
});
// 导出是否全屏

View File

@ -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;

View File

@ -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: () => {

View File

@ -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<void> => {

2
src/render.d.ts vendored
View File

@ -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<boolean>;
setWriteText: (text: string) => void;
onQuit: (callBack: Function) => void;