oae / gnome-shell-pano

Next-gen Clipboard Manager for Gnome Shell
https://extensions.gnome.org/extension/5278/pano/
GNU General Public License v2.0
987 stars 52 forks source link

Pano Pastes Automatically on Login - GNOME 45 #251

Closed derevo closed 6 months ago

derevo commented 6 months ago

Description

Pano automatically pastes active clipboard item upon login

Problem Explanation

When Pano is enabled on GNOME 45, whatever is currently on the clipboard is automatically pasted to whatever application is in focus immediately upon login.

This bug happens when Pano is enabled as a GNOME extension, and happens regardless of whether it is the only enabled extension or is active with other extensions. This bug happens upon any login, including system start, unlocking session, etc. I have only reproduced with an account that requires a password to unlock.

Update: This happens when the "Paste on Select" config is enabled.

Expected Behavior

Expected:

Actual:

Reprodution

Steps To Reproduce

  1. Install Pano, as per standard instructions
  2. Enable Pano as a GNOME extension
  3. Enable the "Paste on Select" configuration option
  4. Copy an item to the clipboard with Pano enabled
  5. Focus an application with a text input
  6. Focus the text input
  7. Lock the current GNOME session with the relevant keyboard shortcut
  8. Unlock the GNOME session with your password
  9. See that your previous clipboard item has now been pasted into the text area of the application you focused in Steps 4 & 5

Details

Mark with [ ] all that applies:

It happens with any application?

It happens only on one computer?

It happens only with some specific gnome configuration?

It happens only with some specific extension installed?

Diagnostics

Under what conditions does it happen?

Fill in all information that applies:

Environment

Application Details

What is pasted, if applicable

The last item copied (current clipboard item)

Application Version

$ app --version  # ...
1.74.3

Output and Logs

Gnome

Command: journalctl --since=now --follow /usr/bin/gnome-shell

$ journalctl --since=now --follow /usr/bin/gnome-shell
Dec 18 09:46:20 fedora gnome-shell[5253]: ../gobject/gsignal.c:2777: instance '0x55d4c90ed3d0' has no handler with id '23398278'
Dec 18 09:46:20 fedora gnome-shell[5253]: [pano] [extension] extension is disabled
Dec 18 09:46:26 fedora gnome-shell[5253]: [pano] [extension] extension is enabled
Dec 18 09:46:27 fedora gnome-shell[5253]: Received multiple virtual 0x1d key releases (ignoring)

Pano Configuration

Command: dconf dump /org/gnome/shell/extensions/pano/

$ dconf dump /org/gnome/shell/extensions/pano/
[/]
global-shortcut=['<Control><Alt>v']
history-length=40
keep-search-entry=false
open-links-in-browser=false
paste-on-select=true
send-notification-on-copy=false
sync-primary=false
wiggle-indicator=false

Enabled Extensions

Command: dconf read /org/gnome/shell/enabled-extensions | tr ' ' '\n'

$ dconf read /org/gnome/shell/enabled-extensions | tr ' ' '\n'
['wintile@nowsci.com',
'pano@elhan.io']
derevo commented 6 months ago

Just a note that I updated the original bug report to show that the "Paste on Select" configuration in Pano seems to be the culprit. If you disable this (I do not remember if it is a default config, or not), then this problem no longer manifests.

So, if this is driving you as crazy as it has driven me, then at least there is a workaround.

za-arthur commented 6 months ago

I can confirm that this issue happens on my laptop too. I disabled "Paste on Select" to see if that helps.

Tommimon commented 6 months ago

Is this a duplicate of #244? The fix should already be merged and should land in next release.

derevo commented 6 months ago

@Tommimon , yes it does seem to be a duplicate, not sure why I couldn't find that issue previously. Thanks for pointing it out!

Tommimon commented 6 months ago

I'm glad this was what you were loocking for! If you don't want to wait for the new release you can patch it yourself, by editing extension.js and replacing:

if (this.settings.get_boolean('paste-on-select')) {

with

if (this.settings.get_boolean('paste-on-select') && this.clipboardManager.isTracking) {

I just tested this and it was on line 1073.

You can see the same changes in the bottom of the relative commit, but on the source file instead of extension.js