PureBasic Forum
https://www.purebasic.fr/english/

PB5.7x qt: More Window incompatibilities (minimize, Focus)
https://www.purebasic.fr/english/viewtopic.php?f=23&t=73744
Page 1 of 1

Author:  Oma [ Sat Oct 05, 2019 4:42 pm ]
Post subject:  PB5.7x qt: More Window incompatibilities (minimize, Focus)

Some further incompatibilities of the subsystem qt compared to Gtk2, Gtk3 and Windows.

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:
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
Regards, Charly

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/