hluk / CopyQ

Clipboard manager with advanced features
GNU General Public License v3.0
8.35k stars 432 forks source link

"Always on Top" works intermittently #2524

Open iG8R opened 9 months ago

iG8R commented 9 months ago

Describe the bug The title speaks for itself - CopyQ's "Always on Top" function doesn't work consistently.

To Reproduce Steps to reproduce the behavior:

  1. Enable the "Always on Top" function.
  2. Try to actively work with CopyQ for a while.
  3. See how the "Always on Top" function stops working.

Expected behavior If the "Always on Top" function is enabled, CopyQ window should always behave according to the enabled function.

Screenshots

CopyQ-Aways-on-Top-Video_2023-10-27_144634.webm

Version, OS and Environment

GFDGIT commented 9 months ago

you also need to disable close_on_unfocus and activate_closes at the same time.

Or, use this script: toggle always_on_top

iG8R commented 9 months ago

Thanks a lot for the advice and script! But, IMHO, such behavior of CopyQ is somehow contradictory in terms of logic and operation:

iG8R commented 9 months ago

@GFDGIT Can you please give me a hint on how to make it so that after disabling the "Always on Top" function using your script, the main window does not close but remains in the background, visible on the taskbar and through Alt+Tab?

iG8R commented 9 months ago

Unfortunately, the script works the same way as when "Always on Top" is manually enabled - sometimes the main window stays on top, sometimes it goes to the background, despite the "Always on Top" option being enabled.

iG8R commented 9 months ago

@GFDGIT Can you please give me a hint on how to make it so that after disabling the "Always on Top" function using your script, the main window does not close but remains in the background, visible on the taskbar and through Alt+Tab?

I figured it out myself - I commented out the following lines in the script and left these parameters disabled in Preferences.

//config("activate_closes",on)
//config("close_on_unfocus",on)
GFDGIT commented 9 months ago
  • logic. I think, it's quit weird when the user needs to adjust other parameters for the one to work properly.

Sorry, I misunderstood your question.In the video, you enabled always_ on_ top, and close when unfocus is closed. In this case, even if the focus is lost, the window should not disappear.

  • operation. As you can see, I didn't change any other parameters only "Always on Top", but sometimes it works and sometimes it doesn't.

I am unable to reproduce the above behavior, may this be a bug? You may want to check if the software has been updated.

GFDGIT commented 9 months ago

Besides, let me explain the impact of the other two options on the always_ on_ top function: Note that their priority is also arranged in the following order!

  1. Close mian window after item activated (in preferences - history, as same as "activatecloses" in the script) When this option enable, window always close after one item activated, even `always on_ top` is enable.

  2. Close when unfocused (in preferences - general, as same as "close_on_unfocus" in the scrupt) when this option enable, window always close when lose focus.

  3. always_ on_ top only controls whether the window is above other windows, without controlling whether it is closed.

In my script, when the always_ on_ top function is enabled, the other two options are turned off simultaneously, achieving a universal sense of always_ on_ top.

iG8R commented 9 months ago

I am unable to reproduce the above behavior, may this be a bug? You may want to check if the software has been updated.

Yes, I think, it's a bug, that is why I've committed this issue.

Besides, let me explain the impact of the other two options on the always_ on_ top function

Thanks a lot!

hluk commented 9 months ago

This is possibly a bug in Qt framework. There is already one workaround in CopyQ to keep the window open when the "Always on Top" flag changes.