diff --git a/CHANGELOG.md b/CHANGELOG.md index afa2cbd..7390a1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fixed folder and filename sanitization to properly handle OS-specific illegal characters (Windows, Linux, macOS), ensuring compatibility across all platforms when creating chapter folders and files. - Fixed `/` and `\` path display by normalizing paths. - Fixed book reprocessing issue where books were being processed every time the chapters window was opened, improving performance when reopening the same book. +- Fixed taskbar icon not appearing correctly in Windows. - Improvements in code and documentation. # 1.1.9 diff --git a/README.md b/README.md index d97402b..a49bf24 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,8 @@ Here’s Abogen in action: in this demo, it processes ∼3,000 characters of tex > Special thanks to [@jborza](https://github.com/jborza) for chapter support in PR [#10](https://github.com/denizsafak/abogen/pull/10) +> Special thanks to [@mleg](https://github.com/mleg) for adding `Line` option in subtitle generation in PR [#94](https://github.com/denizsafak/abogen/pull/94) + | Book handler options | Description | |---------|-------------| | **Chapter Control** | Select specific `chapters` from ePUBs or markdown files or `chapters + pages` from PDFs. | diff --git a/abogen/main.py b/abogen/main.py index 6eda83b..7f089e2 100644 --- a/abogen/main.py +++ b/abogen/main.py @@ -18,6 +18,16 @@ try: except ImportError: print("PyQt5 not installed.") +# Set application ID for Windows taskbar icon +if platform.system() == "Windows": + try: + from abogen.constants import PROGRAM_NAME, VERSION + import ctypes + app_id = f"{PROGRAM_NAME}.{VERSION}" + ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(app_id) + except Exception as e: + print("Warning: failed to set AppUserModelID:", e) + from PyQt5.QtWidgets import QApplication from PyQt5.QtGui import QIcon from PyQt5.QtCore import qInstallMessageHandler, QtMsgType @@ -86,13 +96,6 @@ def qt_message_handler(mode, context, message): # Install the custom message handler qInstallMessageHandler(qt_message_handler) -# Set application ID for Windows taskbar icon -if platform.system() == "Windows": - import ctypes - - app_id = f"{PROGRAM_NAME}.{VERSION}" - ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(app_id) - # Handle Wayland on Linux GNOME if platform.system() == "Linux": xdg_session = os.environ.get("XDG_SESSION_TYPE", "").lower()