Page 1 of 1

PB5.7x qt: More Window incompatibilities (minimize, Focus)

Posted: Sat Oct 05, 2019 4:42 pm
by Oma
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: 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
Regards, Charly

Re: PB5.7x qt: More Window incompatibilities (minimize, Focus)

Posted: Wed Aug 09, 2023 5:33 pm
by Fred
I run some tests and it seems this is the window manager latency which introduce this,
because the commands works as expected if you call them from a button event. I don't know how we can workaround.