Electron: Fix window button avoidance (#6212)

This commit is contained in:
zubiden 2025-09-19 14:34:28 +02:00 committed by Alexander Zinchuk
parent 6af7e510ee
commit de1dd18f31
3 changed files with 7 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import type { LangCode } from '../../../types';
import type { ActionReturnType, GlobalState } from '../../types';
import { requestMutation } from '../../../lib/fasterdom/fasterdom';
import { IS_MULTIACCOUNT_SUPPORTED, IS_TAURI } from '../../../util/browser/globalEnvironment';
import { IS_ELECTRON, IS_MULTIACCOUNT_SUPPORTED, IS_TAURI } from '../../../util/browser/globalEnvironment';
import {
IS_ANDROID, IS_IOS, IS_LINUX,
IS_MAC_OS, IS_SAFARI, IS_TOUCH_ENV, IS_WINDOWS,
@ -174,6 +174,9 @@ addCallback((global: GlobalState) => {
if (IS_TAURI) {
document.body.classList.add('is-tauri');
}
if (IS_ELECTRON) { // Legacy
document.body.classList.add('is-electron');
}
});
const canAnimate = selectCanAnimateInterface(global);

View File

@ -92,7 +92,7 @@ body.is-ios {
--border-radius-messages-small: 0.5rem;
}
body.is-tauri {
body.is-tauri, body.is-electron {
--custom-cursor: default;
--window-controls-width: 5rem;
}

View File

@ -8,3 +8,5 @@ export const IS_BAD_URL_PARSER = new URL('tg://host').host !== 'host';
export const ARE_WEBCODECS_SUPPORTED = 'VideoDecoder' in globalThis;
export const IS_TAURI = isTauri();
// @ts-expect-error no types for electron
export const IS_ELECTRON = Boolean(globalThis.electron);