mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
feat: 添加wayland检查和消息弹窗位置失效说明
This commit is contained in:
@@ -1043,6 +1043,13 @@ function registerIpcHandlers() {
|
||||
return app.getVersion()
|
||||
})
|
||||
|
||||
ipcMain.handle('app:checkWayland', async () => {
|
||||
if (process.platform !== 'linux') return false;
|
||||
|
||||
const sessionType = process.env.XDG_SESSION_TYPE?.toLowerCase();
|
||||
return Boolean(process.env.WAYLAND_DISPLAY || sessionType === 'wayland');
|
||||
})
|
||||
|
||||
ipcMain.handle('log:getPath', async () => {
|
||||
return join(app.getPath('userData'), 'logs', 'wcdb.log')
|
||||
})
|
||||
|
||||
@@ -63,7 +63,8 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
onUpdateAvailable: (callback: (info: { version: string; releaseNotes: string }) => void) => {
|
||||
ipcRenderer.on('app:updateAvailable', (_, info) => callback(info))
|
||||
return () => ipcRenderer.removeAllListeners('app:updateAvailable')
|
||||
}
|
||||
},
|
||||
checkWayland: () => ipcRenderer.invoke('app:checkWayland'),
|
||||
},
|
||||
|
||||
// 日志
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { app } from 'electron'
|
||||
import { join } from 'path'
|
||||
import { existsSync, readdirSync, statSync, readFileSync } from 'fs'
|
||||
import { execFile, exec } from 'child_process'
|
||||
import { execFile, exec, spawn } from 'child_process'
|
||||
import { promisify } from 'util'
|
||||
import { createRequire } from 'module';
|
||||
import { spawn } from 'child_process'
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
const execFileAsync = promisify(execFile)
|
||||
|
||||
Reference in New Issue
Block a user