My program starts with a window set to invisible. On startup a system tray icon appears. So far so good.
1. When I click on the system tray icon the window appears. When I minimize the window, it is hidden again. Perfect.
2. When I click on the system tray icon again, the window does not show up again.
When debugging I noticed that after step 1 WaitWindowEvent throws a minimize event (12) automatically after the systray event (9), which causes the window to never show up again. This is happening on Linux by the way.
Here is the event loop:
Code: Select all
repeat
event = WaitWindowEvent()
select event
case #PB_Event_SysTray
HideWindow(#win1, #false, #PB_Window_ScreenCentered)
case #PB_Event_MinimizeWindow
HideWindow(#win1, #true)
endselect
until event = #PB_Event_CloseWindow