From 1e4d89aac8a6e2932e75687ebfbc1993a15bf143 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Fri, 19 Jan 2024 11:16:33 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Windows=20taskbar=20icon=20workarou?= =?UTF-8?q?nd.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tidal_dl_ng/gui.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py index 810672a..598a8d9 100644 --- a/tidal_dl_ng/gui.py +++ b/tidal_dl_ng/gui.py @@ -484,6 +484,17 @@ def gui_activate(tidal: Tidal | None = None): icon: QtGui.QIcon = QtGui.QIcon(pixmap) app.setWindowIcon(icon) + # This bit gets the taskbar icon working properly in Windows + if sys.platform.startswith("win"): + import ctypes + + # Make sure Pyinstaller icons are still grouped + if not sys.argv[0].endswith(".exe"): + # Arbitrary string + ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID( + "CompanyName.ProductName.SubProduct.VersionInformation" + ) + window = MainWindow(tidal=tidal) window.show()