@@ -26,6 +26,7 @@ function NDI.close_display(::NDI.ElectronDisp; strict)
26
26
end
27
27
28
28
function get_electron_display ()
29
+ app = NDI. get_electron_app ()
29
30
window = NDI. get_electron_window ()
30
31
# BUG: Electron display cannot be reused
31
32
# if isnothing(ELECTRON_DISP[]) || window != ELECTRON_DISP[].window
@@ -34,7 +35,10 @@ function get_electron_display()
34
35
# else
35
36
# ELECTRON_DISP[]
36
37
# end
37
- return HTTPServer. ElectronDisplay (window, HTTPServer. BrowserDisplay (; open_browser= false ))
38
+ return HTTPServer. ElectronDisplay (
39
+ HTTPServer. EWindow (app, window),
40
+ HTTPServer. BrowserDisplay (; open_browser= false )
41
+ )
38
42
end
39
43
40
44
function NDI. get_electron_window ()
@@ -58,14 +62,20 @@ haswindow() = hasapp() && !isempty(windows(ELECTRON_APP[]))
58
62
59
63
function NDI. get_electron_app ()
60
64
if ! hasapp ()
61
- ELECTRON_APP[] = Electron. Application (;
62
- additional_electron_args= [
63
- " --disable-logging" ,
64
- " --no-sandbox" ,
65
- " --user-data-dir=$(mktempdir ()) " ,
66
- " --disable-features=AccessibilityObjectModel" ,
67
- ],
68
- )
65
+ additional_electron_args = [
66
+ " --disable-logging" ,
67
+ " --no-sandbox" ,
68
+ " --user-data-dir=$(mktempdir ()) " ,
69
+ " --disable-features=AccessibilityObjectModel" ,
70
+ " --enable-unsafe-swiftshader" , # ← allow SwiftShader fallback
71
+ ]
72
+ if haskey (ENV , " GITHUB_ACTIONS" )
73
+ append! (additional_electron_args, [
74
+ " --use-gl=swiftshader" , # ← explicitly request software GL
75
+ " --disable-gpu" , # ← disable GPU to avoid GPU errors
76
+ ])
77
+ end
78
+ ELECTRON_APP[] = Electron. Application (; additional_electron_args)
69
79
end
70
80
ELECTRON_APP[]
71
81
end
0 commit comments