mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
feat(desktop): portal-based Linux global shortcuts and PTT (#3185)
This commit is contained in:
1 parent
5799ef705d
commit
8f58fcc4c4
149 files changed
+26849
-8769
No files matched your search
@@ -50,11 +50,12 @@ import {
|
||||
import {destroyDesktopTray, hasActiveDesktopTray, initializeDesktopTray} from '@electron/main/DesktopTray';
|
||||
import {registerDisplayMediaHandlers} from '@electron/main/DisplayMedia';
|
||||
import {initializeDockMenu} from '@electron/main/DockMenu';
|
||||
import {cleanupGlobalKeyHook, registerGlobalKeyHookHandlers} from '@electron/main/GlobalKeyHook';
|
||||
import {cleanupGlobalShortcuts, initializeGlobalShortcuts} from '@electron/main/GlobalShortcutsIpc';
|
||||
import {cleanupIpcHandlers, registerIpcHandlers} from '@electron/main/IpcHandlers';
|
||||
import {initializeJumpList} from '@electron/main/JumpList';
|
||||
import {describeLaunchDiagnosticOptions} from '@electron/main/LaunchOptions';
|
||||
import {cleanupVirtmic, registerVirtmicHandlers} from '@electron/main/LinuxAudioCapture';
|
||||
import {ensureLinuxDesktopEntry} from '@electron/main/LinuxDesktopEntry';
|
||||
import {initializeMainI18n, t} from '@electron/main/MainI18n';
|
||||
import {createApplicationMenu} from '@electron/main/Menu';
|
||||
import {cleanupNativeAudio, registerNativeAudioHandlers} from '@electron/main/NativeAudio';
|
||||
@@ -182,9 +183,6 @@ if (launchConfigurationError) {
|
||||
log.info('Launch diagnostic modes', launchDiagnosticOptions);
|
||||
const CHANNEL_APP_NAME = DESKTOP_APP_NAME;
|
||||
app.setName(CHANNEL_APP_NAME);
|
||||
if (process.platform === 'linux') {
|
||||
process.env.FLUXER_LINUX_DESKTOP_ENTRY_ID = LINUX_DESKTOP_ENTRY_ID;
|
||||
}
|
||||
function recordStartupPhase(phase: string, phaseStartedAt: number): void {
|
||||
log.info('[Startup] Phase completed', {
|
||||
phase,
|
||||
@@ -315,6 +313,15 @@ if (launchConfigurationError) {
|
||||
} catch (error) {
|
||||
log.error('[DebugInfo] Failed to collect desktop debug info:', error);
|
||||
}
|
||||
try {
|
||||
runStartupPhase('linux-desktop-entry', () => {
|
||||
if (ensureLinuxDesktopEntry()) {
|
||||
process.env.FLUXER_LINUX_PORTAL_APP_ID = LINUX_DESKTOP_ENTRY_ID;
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
log.error('[Init] Failed to ensure the Linux desktop entry:', error);
|
||||
}
|
||||
try {
|
||||
runStartupPhase('deep-links', initializeDeepLinks);
|
||||
} catch (error) {
|
||||
@@ -341,9 +348,9 @@ if (launchConfigurationError) {
|
||||
log.error('[Init] Failed to register autostart handlers:', error);
|
||||
}
|
||||
try {
|
||||
runStartupPhase('global-key-hook-handlers', registerGlobalKeyHookHandlers);
|
||||
runStartupPhase('global-shortcuts', initializeGlobalShortcuts);
|
||||
} catch (error) {
|
||||
log.error('[Init] Failed to register global key hook handlers:', error);
|
||||
log.error('[Init] Failed to initialize global shortcuts:', error);
|
||||
}
|
||||
try {
|
||||
runStartupPhase('display-media-handlers', registerDisplayMediaHandlers);
|
||||
@@ -456,7 +463,7 @@ if (launchConfigurationError) {
|
||||
armQuitWatchdog('will-quit');
|
||||
event.preventDefault();
|
||||
cleanupIpcHandlers({quitting: true});
|
||||
cleanupGlobalKeyHook();
|
||||
cleanupGlobalShortcuts();
|
||||
cleanupNativeAudio();
|
||||
cleanupNativeScreenCapture();
|
||||
cleanupNativeHardwareEncoderHandlers();
|
||||
|
||||
Reference in new issue
Block a user