Open Jeinerox opened 1 month ago
I have no idea how this works, but adding a 5-second delay seems to solve the problem. However, having to wait 5 seconds each time before launching the app is a bit frustrating, to be honest. So, this isn't really a solution to the issue.
edit: It seems that Windows may be involved in this issue, causing the window to become a "ghost window". If you reduce the delay, Windows may not detect that the application has frozen, and minimizing the window may stop working again.
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QGuiApplication
from PyQt5.QtQml import QQmlApplicationEngine
import PyTaskbar
from time import sleep
if __name__ == '__main__':
app = QGuiApplication(sys.argv)
engine = QQmlApplicationEngine()
engine.load('interface.qml')
main_window = engine.rootObjects()[0]
sleep(5)
taskbar_progress = PyTaskbar.Progress(hwnd=int(main_window.winId()))
taskbar_progress.init()
if not engine.rootObjects():
sys.exit(-1)
sys.exit(app.exec_())
Describe the bug Hello! I'm having trouble figuring out why my application isn't minimizing when I use your library. I've noticed that when I combine your library with QQmlApplicationEngine, the application doesn't minimize when I click the icon in the taskbar. This only happens when I use this combination, though, as other PyQt classes work fine.
To Reproduce Run this code and see if you can minimize the application by using the taskbar icon.
Expected behavior The app should minimize when the icon is clicked in the taskbar.