Правки в ядре для показа окна поверх всех окон при звонке
This commit is contained in:
@@ -16,7 +16,10 @@ export function ActiveCall() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getConnectingClass = () => {
|
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;
|
return classes.connecting;
|
||||||
}
|
}
|
||||||
if(callState === CallState.ACTIVE){
|
if(callState === CallState.ACTIVE){
|
||||||
|
|||||||
@@ -40,13 +40,13 @@ export function Call(props: CallProps) {
|
|||||||
<Flex style={{
|
<Flex style={{
|
||||||
cursor: 'pointer'
|
cursor: 'pointer'
|
||||||
}} onClick={() => setShowCallView(false)} justify={'center'} align={'center'}>
|
}} onClick={() => setShowCallView(false)} justify={'center'} align={'center'}>
|
||||||
<IconChevronLeft size={20}></IconChevronLeft>
|
<IconChevronLeft color="white" size={20}></IconChevronLeft>
|
||||||
<Text fw={500}>Back</Text>
|
<Text fw={500} c={'white'}>Back</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Flex>
|
<Flex>
|
||||||
<Popover width={300} withArrow>
|
<Popover width={300} disabled={getKeyCast() == ''} withArrow>
|
||||||
<Popover.Target>
|
<Popover.Target>
|
||||||
<IconQrcode size={24}></IconQrcode>
|
<IconQrcode color={getKeyCast() == '' ? 'gray' : 'white'} size={24}></IconQrcode>
|
||||||
</Popover.Target>
|
</Popover.Target>
|
||||||
<Popover.Dropdown p={'xs'}>
|
<Popover.Dropdown p={'xs'}>
|
||||||
<Flex direction={'row'} align={'center'} gap={'xs'}>
|
<Flex direction={'row'} align={'center'} gap={'xs'}>
|
||||||
|
|||||||
@@ -20,10 +20,19 @@ const useWindow = () => {
|
|||||||
window.api.send('window-theme', theme);
|
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 {
|
return {
|
||||||
setSize,
|
setSize,
|
||||||
setResizeble,
|
setResizeble,
|
||||||
setTheme
|
setTheme,
|
||||||
|
setWindowPriority
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 { join } from 'path'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import { WORKING_DIR } from './constants';
|
import { WORKING_DIR } from './constants';
|
||||||
@@ -45,7 +45,8 @@ export function createAppWindow(preloaderWindow?: BrowserWindow): void {
|
|||||||
nodeIntegrationInSubFrames: true,
|
nodeIntegrationInSubFrames: true,
|
||||||
nodeIntegrationInWorker: true,
|
nodeIntegrationInWorker: true,
|
||||||
webSecurity: false,
|
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) {
|
export function foundationIpcRegistration(mainWindow: BrowserWindow) {
|
||||||
|
let bounceId: number | null = null;
|
||||||
ipcMain.removeAllListeners('window-resize');
|
ipcMain.removeAllListeners('window-resize');
|
||||||
ipcMain.removeAllListeners('window-resizeble');
|
ipcMain.removeAllListeners('window-resizeble');
|
||||||
ipcMain.removeAllListeners('window-theme');
|
ipcMain.removeAllListeners('window-theme');
|
||||||
@@ -86,6 +88,38 @@ export function foundationIpcRegistration(mainWindow: BrowserWindow) {
|
|||||||
ipcMain.removeHandler('window-minimize');
|
ipcMain.removeHandler('window-minimize');
|
||||||
ipcMain.removeHandler('showItemInFolder');
|
ipcMain.removeHandler('showItemInFolder');
|
||||||
ipcMain.removeHandler('openExternal');
|
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', () => {
|
ipcMain.handle('open-dev-tools', () => {
|
||||||
if (mainWindow.webContents.isDevToolsOpened()) {
|
if (mainWindow.webContents.isDevToolsOpened()) {
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "Rosetta",
|
"name": "Rosetta",
|
||||||
"version": "1.5.0",
|
"version": "1.5.2",
|
||||||
"description": "Rosetta Messenger",
|
"description": "Rosetta Messenger",
|
||||||
"main": "./out/main/main.js",
|
"main": "./out/main/main.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"build": {
|
"build": {
|
||||||
"electronUpdaterCompatibility": false,
|
"electronUpdaterCompatibility": false,
|
||||||
|
"extraResources": [
|
||||||
|
{ "from": "resources/", "to": "resources/" }
|
||||||
|
],
|
||||||
"files": [
|
"files": [
|
||||||
"node_modules/sqlite3/**/*",
|
"node_modules/sqlite3/**/*",
|
||||||
"out/main/**/*",
|
"out/main/**/*",
|
||||||
|
|||||||
Reference in New Issue
Block a user