From c95b6517b9302c0303518f3b757c40d64ed1ae5f Mon Sep 17 00:00:00 2001 From: Anton Tarasov Date: Thu, 16 Nov 2017 16:26:54 +0300 Subject: [PATCH] IDEA-182266 [windows] do not override app icon --- native/WinLauncher/WinLauncher/WinLauncher.cpp | 3 +++ platform/platform-impl/src/com/intellij/ui/AppUIUtil.java | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/native/WinLauncher/WinLauncher/WinLauncher.cpp b/native/WinLauncher/WinLauncher/WinLauncher.cpp index c67b99c389c8..b292f4a45d20 100644 --- a/native/WinLauncher/WinLauncher/WinLauncher.cpp +++ b/native/WinLauncher/WinLauncher/WinLauncher.cpp @@ -488,6 +488,9 @@ void AddPredefinedVMOptions(std::vector& vmOptionLines) { vmOptionLines.push_back(std::string("-Didea.properties.file=") + propertiesFile); } + std::stringstream id; + id << "-Djbre.win.app.icon.id=" << static_cast(IDI_WINLAUNCHER); + vmOptionLines.push_back(id.str()); } bool LoadVMOptions() diff --git a/platform/platform-impl/src/com/intellij/ui/AppUIUtil.java b/platform/platform-impl/src/com/intellij/ui/AppUIUtil.java index 428b1bf3b831..1ebefce37c2d 100644 --- a/platform/platform-impl/src/com/intellij/ui/AppUIUtil.java +++ b/platform/platform-impl/src/com/intellij/ui/AppUIUtil.java @@ -69,6 +69,12 @@ public class AppUIUtil { private static boolean ourMacDocIconSet = false; public static void updateWindowIcon(@NotNull Window window) { + if (SystemInfo.isWindows && + Integer.getInteger("jbre.win.app.icon.id") != null && + SystemProperties.getBooleanProperty("jbre.win.app.icon.supported", false)) // set by JBRE + { + return; // JBRE will load icon from the exe resource + } ApplicationInfoEx appInfo = ApplicationInfoImpl.getShadowInstance(); List images = ContainerUtil.newArrayListWithCapacity(3);