Copyq: Pasting from menu invoked from indicator focuses incorrect window (v2.9.0)

Created on 21 Mar 2017  路  22Comments  路  Source: hluk/CopyQ

Dear all,

I am experiencing an occasional bug in the latest release.

Steps to reproduce:

  1. Click on the tray icon
  2. Click on an entry in the listed menu to paste into the currently active (focused) window

Expected result:

Paste the content in the active window

Occasional bug behaviour:

The active window loses focus and focus is given to another window. The content of the clipboard is not pasted.

Can someone reproduce this problem?

Yours,

Robert

bug

Most helpful comment

Just tested it on Ubuntu. This is indeed problem in 2.9.0 but seems to be fixed in master branch.

All 22 comments

Just tested it on Ubuntu. This is indeed problem in 2.9.0 but seems to be fixed in master branch.

Thanks! The fix will thus become available in the next release?

@orschiro Yes. I hope to release new version soon.

Also has this bug. On copyq menu, menu shows up near cursor and leaves focus on window under cursor after disappearing. Very irritating.

# from i3 config
bindsym $mod+p       exec --no-startup-id "copyq menu"

@BjornMelgaard Interesting. This seems to be intended behavior in i3, it prevents focusing other windows until keys are released. To bypass this you can add --release argument so the command is run after keys are relased.

bindsym --release $mod+p       exec --no-startup-id "copyq menu"

You can also map the shortcut in CopyQ instead.

@hluk, Neither --release nor shortcut did not worked

@BjornMelgaard I was testing it with not-yet-released CopyQ (from master branch) on i3 4.13 (Arch Linux).

i3 , copyq

$ copyq --version
CopyQ Clipboard Manager v2.9.0 ([email protected])
Built with: Qt 5.8.0, LibQxt 0.7.0
$ i3 --version
i3 version 4.13 (2016-11-08) 漏 2009 Michael Stapelberg and contributors

@BjornMelgaard It's probably because of some changes in master branch. I'm just testing it so I can release it today (or hopefully really soon).

Ok, looking forward to it)

@BjornMelgaard New version is available.

@hluk , no

as you see, after tray is closed, the focus is following mouse
have tried with i3 shortcut - no

$ copyq --version
CopyQ Clipboard Manager v3.0.0 ([email protected])
Built with: Qt 5.8.0, LibQxt 0.7.0

@BjornMelgaard OK, I misunderstood your issue before.

CopyQ focuses previous window when item is selected from menu -- seems to work OK.

If you close the menu with ESC, CopyQ doesn't focus any windows but i3 focuses the window under mouse cursor. Same happens with other floating windows so it seems to be issue in i3 -- i.e. it should set focus to a different window under mouse cursor only if the cursor moves.

I don't think I can do anything about this.

@BjornMelgaard Actually there is this script you can use to launch the menu (requires xdotool).

# Store currently focused window
W=$(xdotool getactivewindow)
# Open the menu
copyq menu
# Wait for menu to close
W2=$(xdotool getactivewindow)
while [[ $W2 == $(xdotool getactivewindow) ]]; do sleep 0.1; done
# Activate last focused window
xdotool windowactivate $W
#!/bin/sh
# Store currently focused window
W=$(xdotool getactivewindow)
echo $W
# Open the menu
copyq menu
# Wait for menu to close
W2=$(xdotool getactivewindow)
echo $W
while [[ $W2 == $(xdotool getactivewindow) ]]; do sleep 0.1; done
# Activate last focused window
xdotool windowactivate $W
 $ ./copyqmenu.sh
46137347
46137347
XGetWindowProperty[_NET_ACTIVE_WINDOW] failed (code=1)
xdo_get_active_window reported an error

:smile: And I am not very good in shell script

Try to use #!/bin/bash instead.

Tried, numbers are same, I will write to i3 tomorrow)

Perhaps sleep 0.5 after the copyq menu would help.

I have found alternative:

 bindsym $mod+p       exec --no-startup-id "copyq show"
 for_window [class="copyq"]             floating enable

And I have tried sleep))

@orschiro Is this still an issue with CopyQ 3.0.0?

@hluk no, it has been resolved. Thank you so much for your responsive solutions. :-)

@orschiro No problem :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

beefeater7 picture beefeater7  路  8Comments

sebflipper picture sebflipper  路  8Comments

bsucker98 picture bsucker98  路  4Comments

nmat picture nmat  路  6Comments

happysurf picture happysurf  路  9Comments