Kolcha / DigitalClock5

beautiful highly customizable clock with plugins
https://digitalclock4.sourceforge.io
GNU General Public License v3.0
6 stars 0 forks source link

invalid - 【stay on top of other windows】 #6

Open biile opened 2 days ago

biile commented 2 days ago

After setting [stay on top of other windows], when switching to other software, the clock's always-on-top function becomes ineffective.

Kolcha commented 1 day ago

first of all, after changing this "stay on top" option app restart is required, unfortunately. this is "necessary evil" in today's world. unfortunately, this simple feature doesn't work properly when you try to change it on runtime. even according to Qt (framework I'm using for UI) documentation, window will disappear after this property change and must be shown explicitly again, but unfortunately it works totally unreliable and may lead to disappearance or even worse to window with very strange properties. window disappearance (required by Qt) contradicts Windows API requirement that states that window must be visible when you are changing its properties. maybe this is the reason. but it works quite normally if it is set during app initialization, so restart is required after changing this ("transparent for mouse events" also requires app restart). in the previous version I had a set of hacks to workaround this case, but they seem not working for the newer Qt, and I don't want to find/invent anything else.

second, in modern world there are a lot of (fullscreen) invisible windows with a very strange properties, which as practice shows may affect this simple feature.

third, Windows can maintain only one "on top" window. many apps can be "too aggressive" in enforcing it - try to detect that they are not on top and then enforce "on top" position again. this is "a response" to user complaints.

forth, many modern UI frameworks directly use OpenGL (or much more often OpenGL ES 2.0). such windows are special, and most of the software can't appear on top of it by default. who knows what is behind JetBrains' Java frameworks... maybe the answer is behind this...

and last but not least, part of the issue somewhere in the Windows itself. don't believe me? try Winamp or whatever else rock-solid old-school software, it also will not work properly, even if it did previously!

so, to conclude - it is the thing you should live as is, it is unlikely that I can do anything around it. it was +/- the same since ~2015 and becoming even worse.