diff options
author | ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com> | 2022-10-28 21:11:51 +0300 |
---|---|---|
committer | ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com> | 2022-11-12 20:19:28 +0200 |
commit | cc5f82bfac162becf55dfcb015f55be3c833bc32 (patch) | |
tree | 0430969006a6b49ee5c1062db47a3ac7058b7a68 /launcher/ui/MainWindow.cpp | |
parent | 4d4dfab38869bca82626e171336cbe8f7c89a1a1 (diff) | |
download | PrismLauncher-cc5f82bfac162becf55dfcb015f55be3c833bc32.tar.gz PrismLauncher-cc5f82bfac162becf55dfcb015f55be3c833bc32.tar.bz2 PrismLauncher-cc5f82bfac162becf55dfcb015f55be3c833bc32.zip |
Windows: fix window icon being replaced
Dunno why it happens but the fix was literally 2 lines, so whatever I guess
Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
Diffstat (limited to 'launcher/ui/MainWindow.cpp')
-rw-r--r-- | launcher/ui/MainWindow.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 9743c822..a87da362 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -2112,6 +2112,10 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered() #if defined(Q_OS_WIN) iconPath = FS::PathCombine(m_selectedInstance->instanceRoot(), "icon.ico"); + // part of fix for weird bug involving the window icon being replaced + // dunno why it happens, but this 2-line fix seems to be enough, so w/e + auto appIcon = QGuiApplication::windowIcon(); + QFile iconFile(iconPath); if (!iconFile.open(QFile::WriteOnly)) { @@ -2129,6 +2133,9 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered() iconFile.close(); iconGenerated = true; + + // restore original window icon + QGuiApplication::setWindowIcon(appIcon); #else iconPath = icon->getFilePath(); #endif |