This commit is contained in:
2026-10-18 00:49:38 +07:00
parent 62d56962e0
commit 7f2a02b69f
8 changed files with 71 additions and 12 deletions
+1
View File
@@ -19,6 +19,7 @@ async function launch(binary, profile, check) {
const child = spawn(
binary,
[
...(process.platform === 'linux' ? ['--ozone-platform=x11'] : []),
`--user-data-dir=${profile}`,
'--remote-debugging-port=0',
'--remote-debugging-address=127.0.0.1',
+2
View File
@@ -201,6 +201,8 @@ app.whenReady().then(async () => {
try {
await seeded
const control = await poll(() => BrowserWindow.getAllWindows()[0], 'control')
if (process.platform === 'linux')
assert.ok(control.getNativeWindowHandle().readUInt32LE(0) > 0xffff, 'native X11 window ID')
control.webContents.on('console-message', (_event, details) =>
console.log('renderer:', details.message),
)
+21
View File
@@ -0,0 +1,21 @@
const { spawn } = require('node:child_process')
const { join } = require('node:path')
// X11 нужен до запуска Electron, чтобы размещать показ на выбранном дисплее.
const child = spawn(
require('electron'),
[
...(process.platform === 'linux' ? ['--ozone-platform=x11'] : []),
process.argv[2],
...process.argv.slice(3),
],
{ cwd: join(__dirname, '..'), stdio: 'inherit' },
)
child.on('error', (error) => {
console.error(error.message)
process.exitCode = 1
})
child.on('exit', (code) => {
process.exitCode = code ?? 1
})
for (const signal of ['SIGINT', 'SIGTERM']) process.on(signal, () => child.kill(signal))