gnome-shell-extension-clipboard-indicator icon indicating copy to clipboard operation
gnome-shell-extension-clipboard-indicator copied to clipboard

Empty string in clipboard after selecting an item using keyboard

Open hron opened this issue 6 years ago • 6 comments
trafficstars

After I had upgraded Ubuntu to 19.10 the extension started acting up a little bit. Here is the precise steps to reproduce my issue.

  1. Select some text and copy it to clipboard
  2. Click on the extension icon and choose some text from the clipboard history
  3. Try to paste the clipboard content with Ctrl-v. This is when the bug appears. It doesn't paste anything although I can see that the item is selected from the top bar indication.
  4. If I select the same item again from the clipboard history again then I can paste it. Moreover if I select something else from the clipboard history it works as expected, but until I copy something new then it is acting up again.

hron avatar Nov 17 '19 08:11 hron

I'm seeing the same behavior on Ubuntu 19.10.

@Tudmotu, if you're short on time, I'd be happy to look into this. I know JavaScript; but I'm not familiar with the API(s) being used. Perhaps you could point me to some relevant documentation?

I added some logging to the extension to try to track down what's happening. So far, this is what I can tell:

  1. _onSelectionChange is being called twice after the initial copying of text. The selectionSource for both calls is GType:MetaSelectionSourceX11. The text returned from Clipboard.get_text in _refreshIndicator for both calls is the text that was copied.
Nov 23 14:25:21 europa gnome-shell[3020]: _onSelectionChange: selectionSource: [object instance wrapper GType:MetaSelectionSourceX11 jsobj@0x7fa4d1497a60 native@0x555f74cbf010]
Nov 23 14:25:21 europa gnome-shell[3020]: _refreshIndicator: text: foo
Nov 23 14:25:21 europa gnome-shell[3020]: _onSelectionChange: selectionSource: [object instance wrapper GType:MetaSelectionSourceX11 jsobj@0x7fa4d14d18b0 native@0x555f77a82380]
Nov 23 14:25:21 europa gnome-shell[3020]: _refreshIndicator: text: foo
  1. When selecting an item from the menu, _onSelectionChange is again called twice. This time, the first selectionSource is GIName:Meta.SelectionSourceMemory. The text returned from Clipboard.get_text in _refreshIndicator is the text that was copied. However, on the second call to _onSelectionChange, the selectionSource is GType:MetaSelectionSourceX11, and the text returned from Clipboard.get_text in _refreshIndicator is empty.
Nov 23 14:28:48 europa gnome-shell[3020]: _onMenuItemSelectedAndMenuClose: Clipboard.set_text(CLIPBOARD_TYPE, foo)
Nov 23 14:28:48 europa gnome-shell[3020]: _onSelectionChange: selectionSource: [object instance wrapper GIName:Meta.SelectionSourceMemory jsobj@0x7fd35cb5ad90 native@0x5584246aa450]
Nov 23 14:28:48 europa gnome-shell[3020]: _refreshIndicator: text: foo
Nov 23 14:28:48 europa gnome-shell[3020]: _onSelectionChange: selectionSource: [object instance wrapper GType:MetaSelectionSourceX11 jsobj@0x7fd35cb97a90 native@0x55842541fda0]
Nov 23 14:28:48 europa gnome-shell[3020]: _refreshIndicator: text:
  1. When selecting an item from the menu again, there is only a single call to _onSelectionChange, with the selectionSource being GIName:Meta.SelectionSourceMemory, and the text returned from Clipboard.get_text in _refreshIndicator being the correct text for that menu item.
Nov 23 14:30:46 europa gnome-shell[3020]: _onMenuItemSelectedAndMenuClose: Clipboard.set_text(CLIPBOARD_TYPE, foo)
Nov 23 14:30:46 europa gnome-shell[3020]: _onSelectionChange: selectionSource: [object instance wrapper GIName:Meta.SelectionSourceMemory jsobj@0x7fd3342ba5b0 native@0x55842651bb90]
Nov 23 14:30:46 europa gnome-shell[3020]: _refreshIndicator: text: foo

justinkusz avatar Nov 23 '19 19:11 justinkusz

@hron, do you happen to use the extension GSConnect or something similar? I found that disabling it (and restarting Gnome) eliminates this issue.

justinkusz avatar Nov 24 '19 00:11 justinkusz

@hron, do you happen to use the extension GSConnect or something similar? I found that disabling it (and restarting Gnome) eliminates this issue.

@justinkusz yep, I use GSConnect

hron avatar Nov 24 '19 07:11 hron

GSConnect has had an update and I've been unable to reproduce this issue. Can you still reproduce it?

KevinAtSesam avatar Dec 02 '19 07:12 KevinAtSesam

Nope!

terencode avatar Dec 02 '19 14:12 terencode

Hi all,

I'm with almost the same issue. However, so far, I notice the problem happens only with Geany text editor in a fresh install Ubuntu 19.10. With Gedit, the clipboard extension works fine. Unfortunately, Geany is my default replacement for Gedit, =/.

jsgadas avatar Dec 11 '19 17:12 jsgadas