diff --git a/projector-launcher/CHANGELOG.md b/projector-launcher/CHANGELOG.md index f1365c235..2e6f1d934 100644 --- a/projector-launcher/CHANGELOG.md +++ b/projector-launcher/CHANGELOG.md @@ -2,6 +2,12 @@ Notable changes to this project are documented in this file. +## 1.0.1 + +## Fixed + +- Taskbar icon not showing on Linux. + # 1.0.0 ## Changed diff --git a/projector-launcher/src/main/kotlin/ElectronApp.kt b/projector-launcher/src/main/kotlin/ElectronApp.kt index 96c8db5a6..23cf54435 100644 --- a/projector-launcher/src/main/kotlin/ElectronApp.kt +++ b/projector-launcher/src/main/kotlin/ElectronApp.kt @@ -81,6 +81,13 @@ class ElectronApp(val url: String) { var preloadPath = path.normalize(path.join(__dirname, "../assets/js/preload.js")) this.mainWindow = BrowserWindow(js(windowOptions)(workAreaSize.width, workAreaSize.height, preloadPath)) + if (process.platform.unsafeCast().toLowerCase() !in setOf("win32", "darwin")) { + // change icon for Linux and other systems: + val iconPath = path.normalize(path.join(__dirname, "assets/img/electron-icon.png")).unsafeCast() + val iconImage = NativeImage.createFromPath(iconPath) + this.mainWindow.setIcon(iconImage) + } + this.mainWindow.webContents.on("did-navigate-in-page") { _: Event, diff --git a/projector-launcher/src/main/kotlin/KElectron.kt b/projector-launcher/src/main/kotlin/KElectron.kt index c81d7df92..96761ac1c 100644 --- a/projector-launcher/src/main/kotlin/KElectron.kt +++ b/projector-launcher/src/main/kotlin/KElectron.kt @@ -1474,6 +1474,7 @@ external interface MouseWheelInputEvent : MouseInputEvent { set(value) = definedExternally } +@JsName("nativeImage") open external class NativeImage { open fun addRepresentation(options: AddRepresentationOptions) open fun crop(rect: Rectangle): NativeImage @@ -5473,8 +5474,6 @@ external var ipcMain: IpcMain external var ipcRenderer: IpcRenderer -external var nativeImage: Any - external var nativeTheme: NativeTheme external var net: Net diff --git a/projector-launcher/webpack.config.d/webpack.config.js b/projector-launcher/webpack.config.d/webpack.config.js index 3e8606969..81bd3a622 100644 --- a/projector-launcher/webpack.config.d/webpack.config.js +++ b/projector-launcher/webpack.config.d/webpack.config.js @@ -24,3 +24,7 @@ // todo: remove after https://youtrack.jetbrains.com/issue/KT-35327 is fixed config.target = 'electron-renderer'; +// fix root dir: https://webconfiguration.wordpress.com/2017/12/04/__dirname-resolving-to-root-of-disk/ +config.node = config.node || {}; +config.node.__dirname = false; +config.node.__filename = false;