Expectation: I click outside the window, the window hides and shows up after to seconds and I can click outside again to repeat.......Help Text: The window is automatically activated (gets the focus),
This works on Linux as expected, doesn't work on Windows.
=> Different OS behavior.
=> Maybe I should stop comparing the two OSs with each other?
Code: Select all
Macro RStr(Value, Length)
RSet(Str(Value), Length)
EndMacro
If OpenWindow(0, 0, 0, 320, 120, "Hide Window for a while ...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StickyWindow(0, 1)
TextGadget(1, 10, 10, 300, 20, "")
TextGadget(2, 10, 40, 300, 20, "")
; StringGadget(3, 10, 70, 300, 20, "") ; <-- not helping
AddWindowTimer(0, 1, 100)
AddWindowTimer(0, 2, 2000) ; hide the window for 2 s
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_DeactivateWindow
HideWindow(0, 1)
; Break
Case #PB_Event_Timer
If EventTimer() = 1
mx = DesktopMouseX()
my = DesktopMouseY()
SetGadgetText(1, "Desktop Mouse Pos: " + RStr(mx, 4) + ", " + RStr(my, 4))
mx = WindowMouseX(0)
my = WindowMouseY(0)
SetGadgetText(2, "Window Mouse Pos: " + RStr(mx, 4) + ", " + RStr(my, 4))
EndIf
If EventTimer() = 2
HideWindow(0, 0)
; SetActiveWindow(0) ; <-- not needed on linux, no effect on window
; SetActiveGadget(2) ; <-- not working on window
EndIf
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf


