@@ -33,7 +33,7 @@ export class OverlayWindow {
3333
3434 if ( process . argv . includes ( "--no-overlay" ) ) return ;
3535
36- this . window = new BrowserWindow ( {
36+ const windowOpts : Electron . BrowserWindowConstructorOptions = {
3737 icon : path . join ( __dirname , process . env . STATIC ! , "icon.png" ) ,
3838 ...OVERLAY_WINDOW_OPTS ,
3939 width : 800 ,
@@ -43,7 +43,16 @@ export class OverlayWindow {
4343 webviewTag : true ,
4444 spellcheck : false ,
4545 } ,
46- } ) ;
46+ } ;
47+
48+ // Linux/X11: Special window configuration
49+ if ( process . platform === "linux" ) {
50+ windowOpts . skipTaskbar = true ;
51+ windowOpts . focusable = true ;
52+ windowOpts . type = "notification" ; // Best balance of focus handling and stability
53+ }
54+
55+ this . window = new BrowserWindow ( windowOpts ) ;
4756
4857 this . window . setMenu (
4958 Menu . buildFromTemplate ( [
@@ -63,6 +72,12 @@ export class OverlayWindow {
6372
6473 this . window . webContents . setWindowOpenHandler ( ( details ) => {
6574 shell . openExternal ( details . url ) ;
75+ // Linux: Return focus to game after external link
76+ if ( process . platform === "linux" ) {
77+ setTimeout ( ( ) => {
78+ OverlayController . focusTarget ( ) ;
79+ } , 100 ) ;
80+ }
6681 return { action : "deny" } ;
6782 } ) ;
6883 }
@@ -87,6 +102,11 @@ export class OverlayWindow {
87102 assertOverlayActive = ( ) => {
88103 if ( ! this . isInteractable ) {
89104 this . isInteractable = true ;
105+ // Linux needs explicit focus management
106+ if ( process . platform === "linux" && this . window ) {
107+ this . window . setFocusable ( true ) ;
108+ this . window . focus ( ) ;
109+ }
90110 OverlayController . activateOverlay ( ) ;
91111 this . poeWindow . isActive = false ;
92112 }
@@ -95,6 +115,10 @@ export class OverlayWindow {
95115 assertGameActive = ( ) => {
96116 if ( this . isInteractable ) {
97117 this . isInteractable = false ;
118+ // Linux needs to release focus explicitly
119+ if ( process . platform === "linux" && this . window ) {
120+ this . window . setFocusable ( false ) ;
121+ }
98122 OverlayController . focusTarget ( ) ;
99123 this . poeWindow . isActive = true ;
100124 }
0 commit comments