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

Linux specific forum
Oma
Enthusiast
Enthusiast
Posts: 312
Joined: Thu Jun 26, 2014 9:17 am
Location: Germany

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

Post 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
PureBasic 5.4-5.7, Linux: (X/L/K)Ubuntus+Mint - Windows XP (32Bit)
PureBasic Linux-API-Library & Viewer: http://www.chabba.de
Fred
Administrator
Administrator
Posts: 16622
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

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

Post 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.
Post Reply