Page 1 of 1
QT - StickyWindow does not work
Posted: Wed Jan 09, 2019 11:55 pm
by macros
Code: Select all
If OpenWindow(1, 0, 0, 322, 150, "Nonsticky Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
StickyWindow(1,1)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
What should happen:
Windows stays on top
What does happen:
Window moves to background, requires two clicks to be brought to active state.
Does not stay on top
Video
There is a button to make windows stay on top, it should be highlighted if the state is successfully activated, like it is when I click the button in the video.
Focus stealing prevention is turned off.
System:
Kubuntu 18.04
Purebasic 5.70
StickyWindow() works with gtk subsystems.
Re: PB 5.70 QT - StickyWindow does not work
Posted: Thu Jan 10, 2019 9:18 am
by #NULL
What happens here is that running the code repeatedly without changes sometimes results in a sticky window and sometimes it doesn't.
PB570LTS x64, Ubuntu 18.04
Re: PB 5.70 QT - StickyWindow does not work
Posted: Thu Jan 10, 2019 2:16 pm
by deeproot
#NULL wrote:What happens here is that running the code repeatedly without changes sometimes results in a sticky window and sometimes it doesn't.
Same here - appears random.
However, inserting Delay(500) between the OpenWindow and StickyWindow results in the window always being sticky (well - so far at least !!)
PB 5.70LTS x64 (qt subs), MX Linux 18
Re: PB 5.70 QT - StickyWindow does not work
Posted: Sun Jan 13, 2019 5:54 pm
by macros
On another PC (PC2) I do not get the behaviour that the windows move to the background.
and after a delay it sometimes works.
(On PC1 I tried: Delays, Delays with a window refresh loop, toggling off on, nothing worked)
Here a code which toggle the On Top state every second:
Code: Select all
If OpenWindow(1, 0, 0, 322, 150, "Nonsticky Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Repeat
If ElapsedMilliseconds()-time>1000
state!1
StickyWindow(1,state)
time=ElapsedMilliseconds()
EndIf
Until WaitWindowEvent(10) = #PB_Event_CloseWindow
EndIf
With gtk this works as expected on PC2. With qt....
it gets weird.
The window flashes on each StickyWindow() call, but only changes its sticky state if the mouse hovers on it.
If the mouse gets to close to the title bar, it moves up a bit on the next state change.
In the video I do not click on the window till I close it.
Re: PB 5.70 QT - StickyWindow does not work
Posted: Wed Aug 09, 2023 5:35 pm
by Fred
We use the standard Qt::WindowStaysOnTopHint to set the window on top, but according to the QT doc, it can fail (
https://doc.qt.io/qt-5/qt.html#WindowType-enum - I tried to use the X11Bypass flag as well, but it remove all window decoreation so it's worse).
It fails on Ubuntu 18.04 and Ubuntu 20.04 here. There was QT bug report about this as well, so may be it works for more recent QT version
https://bugreports.qt.io/browse/QTBUG-69515
Re: PB 5.70 QT - StickyWindow does not work
Posted: Wed Aug 09, 2023 7:21 pm
by macros
Thank you for revisiting this old bug report!
I can confirm that it works now under Kubuntu 23.04
In a VM with Kubuntu 22.04.2 LTS the bug still occurs.
So it appears to be fixed on QTs side