@@ -2,7 +2,7 @@ import type { BrowserWindow } from 'electron'
22
33import type { WidgetsWindowManager } from './windows/widgets'
44
5- import { platform } from 'node:process'
5+ import { env , platform } from 'node:process'
66
77import { electronApp , optimizer } from '@electron-toolkit/utils'
88import { Format , LogLevel , setGlobalFormat , setGlobalLogLevel , useLogg } from '@guiiai/logg'
@@ -51,6 +51,18 @@ if (isLinux) {
5151 app . commandLine . appendSwitch ( 'enable-features' , 'SharedArrayBuffer' )
5252 app . commandLine . appendSwitch ( 'enable-unsafe-webgpu' )
5353 app . commandLine . appendSwitch ( 'enable-features' , 'Vulkan' )
54+
55+ // NOTICE: we need UseOzonePlatform, WaylandWindowDecorations for working on Wayland.
56+ // Partially related to https://github.com/electron/electron/issues/41551, since X11 is deprecating now,
57+ // we can safely remove the feature flags for Electron once they made it default supported.
58+ // Fixes: https://github.com/moeru-ai/airi/issues/757
59+ // Ref: https://github.com/mmaura/poe2linuxcompanion/blob/90664607a147ea5ccea28df6139bd95fb0ebab0e/electron/main/index.ts#L28-L46
60+ if ( env . XDG_SESSION_TYPE === 'wayland' ) {
61+ app . commandLine . appendSwitch ( 'enable-features' , 'GlobalShortcutsPortal' )
62+
63+ app . commandLine . appendSwitch ( 'enable-features' , 'UseOzonePlatform' )
64+ app . commandLine . appendSwitch ( 'enable-features' , 'WaylandWindowDecorations' )
65+ }
5466}
5567
5668app . dock ?. setIcon ( icon )
0 commit comments