Forráskód Böngészése

runs with actual linux-we now

UwU 7 hónapja
szülő
commit
85d778fca7
5 módosított fájl, 1173 hozzáadás és 87 törlés
  1. 0 1
      .gitignore
  2. 1109 73
      package-lock.json
  3. 33 2
      package.json
  4. 7 1
      src/main/ipc/wallpaper.handlers.ts
  5. 24 10
      src/main/services/lwe.service.ts

+ 0 - 1
.gitignore

@@ -4,4 +4,3 @@ dist/
 .env
 *.db
 preview-cache/
-.nanocoder/

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1109 - 73
package-lock.json


+ 33 - 2
package.json

@@ -3,22 +3,28 @@
   "version": "0.1.0",
   "type": "module",
   "description": "Wallpaper Engine workshop manager",
+  "author": {
+    "name": "WE Manager",
+    "email": "developer@example.com"
+  },
   "main": "out/main/index.js",
   "scripts": {
     "dev": "electron-vite dev",
     "build": "electron-vite build",
     "preview": "electron-vite preview",
+    "dist": "npm run build && electron-builder",
+    "dist:linux": "npm run build && electron-builder --linux",
     "postinstall": "echo 'Dependencies installed'"
   },
   "dependencies": {
+    "@tanstack/react-query": "^5.59.0",
     "clsx": "^2.1.1",
     "electron-store": "^10.0.0",
     "lucide-react": "^0.460.0",
     "react": "^18.3.1",
     "react-dom": "^18.3.1",
     "steamworks.js": "^0.4.0",
-    "zustand": "^4.5.2",
-    "@tanstack/react-query": "^5.59.0"
+    "zustand": "^4.5.2"
   },
   "devDependencies": {
     "@electron-toolkit/preload": "^3.0.0",
@@ -29,10 +35,35 @@
     "@vitejs/plugin-react": "^4.3.1",
     "autoprefixer": "^10.4.20",
     "electron": "^33.0.0",
+    "electron-builder": "^26.7.0",
     "electron-vite": "^2.3.0",
     "postcss": "^8.4.47",
     "tailwindcss": "^3.4.14",
     "typescript": "^5.6.3",
     "vite": "^5.4.10"
+  },
+  "build": {
+    "appId": "com.we-manager.app",
+    "productName": "WE Manager",
+    "directories": {
+      "output": "dist"
+    },
+    "linux": {
+      "target": [
+        {
+          "target": "AppImage",
+          "arch": ["x64"]
+        },
+        {
+          "target": "deb",
+          "arch": ["x64"]
+        }
+      ],
+      "category": "Utility"
+    },
+    "files": [
+      "out/**/*",
+      "node_modules/**/*"
+    ]
   }
 }

+ 7 - 1
src/main/ipc/wallpaper.handlers.ts

@@ -32,8 +32,14 @@ export function registerWallpaperHandlers(): void {
     const isAnimated = wallpaper.type === 'scene' || wallpaper.type === 'web' || wallpaper.type === 'video'
     const lwe = getLweStatus()
 
+    // Check if we're on KDE Wayland - LWE has GLEW 2.3.0+ compatibility issues
+    const isWayland = !!(process.env.WAYLAND_DISPLAY || 
+      (process.env.XDG_SESSION_TYPE === 'wayland') ||
+      (process.env.XDG_CURRENT_DESKTOP?.toLowerCase().includes('kde')))
+    
     // Use linux-wallpaperengine for animated wallpapers on Linux if available
-    if (isAnimated && os.platform() === 'linux' && lwe.installed) {
+    // Skip on KDE Wayland due to GLEW 2.3.0+ compatibility issues
+    if (isAnimated && os.platform() === 'linux' && lwe.installed && !isWayland) {
       await launchLweAsync(wallpaper.localPath)
 
       store.set('activeWallpaperId', options.wallpaperId)

+ 24 - 10
src/main/services/lwe.service.ts

@@ -414,11 +414,12 @@ function getLweLdLibraryPath(): string {
   // IMPORTANT: Do NOT include binDir itself (e.g. /usr/local) because CEF installs its own
   // libEGL.so / libGLESv2.so there which shadow the system Mesa EGL and break Wayland rendering.
   // Only include proper lib subdirectories where LWE's own libs (libkissfft, etc.) live.
+  // Ensure lib64 comes first as it contains critical libraries like libkissfft
   const candidates = [
-    path.join(binDir, 'lib'),
-    path.join(binDir, 'lib64'),
+    '/usr/local/lib64',  // Prioritize lib64 for critical LWE dependencies
     '/usr/local/lib',
-    '/usr/local/lib64'
+    path.join(binDir, 'lib64'),
+    path.join(binDir, 'lib')
   ]
   // Only include paths that actually exist
   const paths = candidates.filter(p => {
@@ -468,14 +469,27 @@ function buildLweEnvVars(): string[] {
   // binary causes the dynamic linker to pick it up instead of Mesa's system EGL. CEF's EGL
   // doesn't support eglGetPlatformDisplayEXT for Wayland, breaking --screen-root mode.
   // Force the system EGL via LD_PRELOAD so Mesa's implementation is used.
-  const systemEgl = ['/lib64/libEGL.so.1', '/usr/lib64/libEGL.so.1', '/usr/lib/libEGL.so.1']
-    .find(p => fs.existsSync(p))
-  if (systemEgl) vars.push(`LD_PRELOAD=${systemEgl}`)
-
-  // Electron may run under XWayland and lack WAYLAND_DISPLAY.
-  // LWE needs it to use Wayland layer-shell for desktop rendering.
+  const systemEglPaths = [
+    '/usr/lib64/libEGL.so.1',
+    '/usr/lib/libEGL.so.1',
+    '/lib64/libEGL.so.1',
+    '/usr/local/lib64/libEGL.so.1',
+    '/usr/local/lib/libEGL.so.1'
+  ]
+  // Detect Wayland display once and reuse
   const waylandDisplay = process.env.WAYLAND_DISPLAY || getWaylandDisplay()
-  if (waylandDisplay) vars.push(`WAYLAND_DISPLAY=${waylandDisplay}`)
+
+  if (waylandDisplay) {
+    // For Wayland, use minimal environment to avoid EGL conflicts
+    vars.push(`WAYLAND_DISPLAY=${waylandDisplay}`)
+    vars.push('EGL_PLATFORM=wayland')
+  } else {
+    // X11 fallback - use LD_PRELOAD for EGL
+    const systemEgl = systemEglPaths.find(p => fs.existsSync(p))
+    if (systemEgl) {
+      vars.push(`LD_PRELOAD=${systemEgl}`)
+    }
+  }
 
   // Ensure DISPLAY is passed (for X11 fallback)
   if (process.env.DISPLAY) vars.push(`DISPLAY=${process.env.DISPLAY}`)

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott