AbdelrahmanBayoumi / Azkar-App

Desktop Application 💻 for Calculating Muslim prayer times 🕌 , Morning and Nights Azkar 🤲 with notification for random Azkar that pops-up in specific time.
https://azkar-site.web.app/
MIT License
101 stars 9 forks source link

Issue with Restoring Application from System Tray after PC Wakes from Sleep #54

Open AbdelrahmanBayoumi opened 4 months ago

AbdelrahmanBayoumi commented 4 months ago

Description: There is a problem with the application's ability to restore from the system tray after the PC wakes from sleep. The app does not open when clicking the tray icon, and the memory usage in the task manager shows only 20MB, while normally it should be around 150MB.

Steps to Reproduce: Unfortunately, this issue does not happen all the time, so there are no specific steps to reproduce it consistently.

Expected Behavior: The application should restore and display the main window when clicking the tray icon after the PC wakes from sleep.

Actual Behavior: The application does not restore and remains in the system tray. The task manager shows the application is using only 20MB of memory, which is significantly less than the normal 150MB.

Additional Information:

Possible Cause: It might be related to how the application handles system sleep and wake events. Proper handling of these events could help maintain the application state and prevent issues with memory usage.

Suggested Solution: Implement a system event listener to handle sleep and wake events, ensuring the application restores correctly from the system tray. Using a native library like JNA (Java Native Access) to interface with the Windows API might help in detecting these power events.