hluk / CopyQ

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

Main window is not closed automatically after clicking on desktop #1907

Open Vzz1c opened 2 years ago

Vzz1c commented 2 years ago

I set the [close when not focused], but I do not work when I am on the desktop, will only be closed when I click on other programs, because I clicked on the desktop and CopyQ is not focused, at this time I can not use the shortcut keys to close, and I can only click on the CopyQ window, and then press the shortcut keys to close, I think this is not a good idea

hluk commented 2 years ago

Please provide app version, system and desktop environment.

lkrms commented 2 years ago

Hi @hluk. I'm seeing this behaviour on macOS, regardless of how the main window is opened.

CopyQ version: 6.0.1-gf4773644-v6.0.1 macOS: Monterey 12.2.1 (Apple M1 if relevant)

I also use CopyQ on Linux (Arch) and haven't noticed the issue there.

hluk commented 2 years ago

The main window is only closed when it is unfocused/deactivated and it has no open dialogs.

lkrms commented 2 years ago

The main window is only closed when it is unfocused/deactivated and it has no open dialogs.

That's how it works on Linux, but it doesn't behave the same way on macOS. I've only recently switched from Flycut to CopyQ on macOS--now that CopyQ is so stable on mac (thank you!)--so I'm not sure how long it's been an issue, or if it's only since a recent macOS update. I'll let you know if I have a chance to do more testing and see anything different.

nmat commented 2 years ago

verified this on macOS Big Sur

Seems to behave correctly on windows though

Version: 6.1.0

The Esc key to close focus and window works though.

nmat commented 2 years ago

This might not be the same effect but on windows I can reproduce this in a different way.

  1. make sure you have: notepad.exe "%1" as the external editor in history preferences
  2. have chrome or similar application open
  3. open copyq with hotkey
  4. go to a tab and press Ctrl+E to open in external editor
  5. close editor and click in chrome

Result: copyq window is still open pressing Esc does nothing.

I am not sure if this is the same problem but the behaviour is the same.

Vzz1c commented 2 years ago

I think some people understand too complicated, this is not a bug, but a mechanism that I think is bad, so I solved it perfectly by a simple ahk program, which is a generic code.

close(){ MouseGetPos, , , id, control WinGetClass, class,ahk_id %id% if(class = "Progman"){ WinGet copyQId ,,ahk_exe copyq.exe if WinExist("ahk_id" copyQId){ WinClose } } } ~LButton:: close() return

Vzz1c commented 2 years ago

Also fixed the problem of using CTRL+C when selecting text in the preview window, but the substring does not appear in the clipboard display, in addition, I need a feature that can drag files and text, not just images, which I have not been able to achieve, so I was forced to return to "ditto", if you add these three features I will definitely come back

+#^Q:: Send,^c ClipWait, 1 if ErrorLevel { return } path = %Clipboard% Clipboard = %path% return

IfWinActive ahk_exe copyq.exe

~^c:: send,+#^Q return

If

copyQClose(){ MouseGetPos, , , id, control WinGetClass, class,ahk_id %id% if(class = "Progman"){ WinGet copyQId ,,ahk_exe copyq.exe if WinExist("ahk_id" copyQId){ WinClose } } } ~LButton:: copyQClose() return

andrewcincotta commented 1 year ago

I'd like to bump this issue back to the top because as of the latest version (7), I get the same issue. Pressing Cmd+W or Esc will close the window, however unfocusing the window through pressing on another application or using the application switcher will not close the copyq window.