Правки в ядре для показа окна поверх всех окон при звонке

This commit is contained in:
RoyceDa
2026-03-18 18:28:37 +02:00
parent 41d7a89830
commit 824b1fec65
5 changed files with 58 additions and 9 deletions

View File

@@ -16,7 +16,10 @@ export function ActiveCall() {
}
const getConnectingClass = () => {
if(callState === CallState.CONNECTING){
if(callState === CallState.CONNECTING
|| callState === CallState.INCOMING
|| callState === CallState.KEY_EXCHANGE
|| callState === CallState.WEB_RTC_EXCHANGE){
return classes.connecting;
}
if(callState === CallState.ACTIVE){

View File

@@ -40,13 +40,13 @@ export function Call(props: CallProps) {
<Flex style={{
cursor: 'pointer'
}} onClick={() => setShowCallView(false)} justify={'center'} align={'center'}>
<IconChevronLeft size={20}></IconChevronLeft>
<Text fw={500}>Back</Text>
<IconChevronLeft color="white" size={20}></IconChevronLeft>
<Text fw={500} c={'white'}>Back</Text>
</Flex>
<Flex>
<Popover width={300} withArrow>
<Popover width={300} disabled={getKeyCast() == ''} withArrow>
<Popover.Target>
<IconQrcode size={24}></IconQrcode>
<IconQrcode color={getKeyCast() == '' ? 'gray' : 'white'} size={24}></IconQrcode>
</Popover.Target>
<Popover.Dropdown p={'xs'}>
<Flex direction={'row'} align={'center'} gap={'xs'}>

View File

@@ -20,10 +20,19 @@ const useWindow = () => {
window.api.send('window-theme', theme);
}
const setWindowPriority = (isTop: boolean) => {
if(isTop){
window.api.invoke('window-top');
} else {
window.api.invoke('window-priority-normal');
}
}
return {
setSize,
setResizeble,
setTheme
setTheme,
setWindowPriority
}
}

View File

@@ -1,4 +1,4 @@
import { BrowserWindow, shell, ipcMain, nativeTheme, screen, powerMonitor } from 'electron'
import { BrowserWindow, shell, ipcMain, nativeTheme, screen, powerMonitor, app } from 'electron'
import { join } from 'path'
import fs from 'fs'
import { WORKING_DIR } from './constants';
@@ -45,7 +45,8 @@ export function createAppWindow(preloaderWindow?: BrowserWindow): void {
nodeIntegrationInSubFrames: true,
nodeIntegrationInWorker: true,
webSecurity: false,
allowRunningInsecureContent: true
allowRunningInsecureContent: true,
autoplayPolicy: 'no-user-gesture-required'
}
});
@@ -73,6 +74,7 @@ export function createAppWindow(preloaderWindow?: BrowserWindow): void {
}
export function foundationIpcRegistration(mainWindow: BrowserWindow) {
let bounceId: number | null = null;
ipcMain.removeAllListeners('window-resize');
ipcMain.removeAllListeners('window-resizeble');
ipcMain.removeAllListeners('window-theme');
@@ -86,6 +88,38 @@ export function foundationIpcRegistration(mainWindow: BrowserWindow) {
ipcMain.removeHandler('window-minimize');
ipcMain.removeHandler('showItemInFolder');
ipcMain.removeHandler('openExternal');
ipcMain.removeHandler('window-top');
ipcMain.removeHandler('window-priority-normal');
ipcMain.handle('window-top', () => {
if (mainWindow.isMinimized()){
mainWindow.restore();
}
mainWindow.setAlwaysOnTop(true, "screen-saver"); // самый высокий уровень
mainWindow.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true });
mainWindow.show();
mainWindow.focus();
if (process.platform === "darwin") {
/**
* Только в macos! Подпрыгивание иконки в Dock
*/
bounceId = app.dock!.bounce("critical");
}
})
ipcMain.handle('window-priority-normal', () => {
mainWindow.setAlwaysOnTop(false);
mainWindow.setVisibleOnAllWorkspaces(false);
if(process.platform === "darwin" && bounceId !== null){
/**
* Только в macos! Отмена подпрыгивания иконки в Dock
*/
app.dock!.cancelBounce(bounceId);
bounceId = null;
}
})
ipcMain.handle('open-dev-tools', () => {
if (mainWindow.webContents.isDevToolsOpened()) {

View File

@@ -1,11 +1,14 @@
{
"name": "Rosetta",
"version": "1.5.0",
"version": "1.5.2",
"description": "Rosetta Messenger",
"main": "./out/main/main.js",
"license": "MIT",
"build": {
"electronUpdaterCompatibility": false,
"extraResources": [
{ "from": "resources/", "to": "resources/" }
],
"files": [
"node_modules/sqlite3/**/*",
"out/main/**/*",