On my main system (Xubuntu 18.04, x64), the command GetActiveWindow() will always return -1, even if I use SetActiveWindow(#Window).
If I use SetActiveWindow(#Window) before, minimizing the window with SetWindowState(#Window, #PB_Window_Minimize) under Qt doesn't work!
An example...
Code: Select all
EnableExplicit
; Object constants
#Win_Main = 10
Global.i gEvent, gQuit
Procedure Create_WinMain()
If OpenWindow(#Win_Main, 300, 200, 600, 200, "Window minimize & 'GetActiveWindow()' incompatibility on qt ", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_MinimizeGadget)
EndIf
EndProcedure
Create_WinMain()
Debug GetActiveWindow()
;shows -1 on qt but 10 on gtk2, gtk3, Windows
SetActiveWindow(#Win_Main); Try it under qt with this line commented out!
Debug GetActiveWindow()
;shows again -1 on qt but a correct 10 on gtk2, gtk3, Windows
;If 'SetActiveWindow(#Win_Main)' not commented out, the following command does not iconify the window under qt. Gtk2, gtk3, Windows is okay.
SetWindowState(#Win_Main, #PB_Window_Minimize)
Repeat
gEvent= WaitWindowEvent()
Select gEvent
Case #PB_Event_CloseWindow
gQuit= #True
EndSelect
Until gQuit