@@ -33,7 +33,7 @@ export class OverlayWindow {
33
33
34
34
if ( process . argv . includes ( "--no-overlay" ) ) return ;
35
35
36
- this . window = new BrowserWindow ( {
36
+ const windowOpts : Electron . BrowserWindowConstructorOptions = {
37
37
icon : path . join ( __dirname , process . env . STATIC ! , "icon.png" ) ,
38
38
...OVERLAY_WINDOW_OPTS ,
39
39
width : 800 ,
@@ -43,7 +43,16 @@ export class OverlayWindow {
43
43
webviewTag : true ,
44
44
spellcheck : false ,
45
45
} ,
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 ) ;
47
56
48
57
this . window . setMenu (
49
58
Menu . buildFromTemplate ( [
@@ -63,6 +72,12 @@ export class OverlayWindow {
63
72
64
73
this . window . webContents . setWindowOpenHandler ( ( details ) => {
65
74
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
+ }
66
81
return { action : "deny" } ;
67
82
} ) ;
68
83
}
@@ -87,6 +102,11 @@ export class OverlayWindow {
87
102
assertOverlayActive = ( ) => {
88
103
if ( ! this . isInteractable ) {
89
104
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
+ }
90
110
OverlayController . activateOverlay ( ) ;
91
111
this . poeWindow . isActive = false ;
92
112
}
@@ -95,6 +115,10 @@ export class OverlayWindow {
95
115
assertGameActive = ( ) => {
96
116
if ( this . isInteractable ) {
97
117
this . isInteractable = false ;
118
+ // Linux needs to release focus explicitly
119
+ if ( process . platform === "linux" && this . window ) {
120
+ this . window . setFocusable ( false ) ;
121
+ }
98
122
OverlayController . focusTarget ( ) ;
99
123
this . poeWindow . isActive = true ;
100
124
}
0 commit comments