kdeconnect-kde/plugins/clipboard
Arjan Marku 16ccee7ac9 fix: don't send clipboard network packets on empty text
If you lock the screen in EndeavourOS, a signal KSystemClipboard:changed is emitted with empty text and clipboard mode QClipboard::Clipboard. Upon unlock the clipboard will be re-synced.

A clipboard network packet will be sent for KSystemClipboard::changed signals if:
1. the received mode is QClipboard::Clipboard
2. the new content and its type are different from the current ones.

The problem here is that, before locking the screen, current content is not empty. As of condition #2, a network packet with the empty text will be sent, which clears the current clipboard selection in GBoard but the contents stay the same. Upon re-sync in unlock, a packet will be sent again due to #2.

This commit aims to fix this by ignoring empty text updates since from the end-user it unnecessarily clears the current clipboard selection and results in many "Copied to clipboard" toasts.
2024-08-12 11:06:11 +00:00
..
clipboard_config.cpp Do not make m_ui instance a ptr 2023-07-30 07:27:45 +00:00
clipboard_config.h Do not make m_ui instance a ptr 2023-07-30 07:27:45 +00:00
clipboard_config.ui Allow disabling clipboard auto-share and add option to share manually 2023-06-07 19:48:25 +00:00
clipboardlistener.cpp fix: don't send clipboard network packets on empty text 2024-08-12 11:06:11 +00:00
clipboardlistener.h Use pragma once in plugins 2023-07-22 20:51:19 +00:00
clipboardplugin.cpp fix: do not send NetworkPacket if autoshare is disabled when connecting 2024-03-31 14:48:12 +00:00
clipboardplugin.h Simplify KDEConnectPlugin::recievePacket 2023-08-03 20:49:44 +02:00
CMakeLists.txt Cleanup all occurences of QT_MAJOR_VERSION in cmake 2023-12-28 17:49:07 +01:00
kdeconnect_clipboard.json Add custom JSON schema, extending KPluginMetaData and enforcing KDE-Connect specific keys 2024-08-12 11:01:22 +00:00
kdeconnect_clipboard_config.qml Allow disabling clipboard auto-share and add option to share manually 2023-06-07 19:48:25 +00:00
README Move the plugins into a different top-ĺevel directory 2014-06-14 16:34:11 +02:00

When the clipboard changes, it sends a package with type kdeconnect.clipboard
and the field "content" (string) containing the new clipboard content.

When it receivest a package of the same kind, it should update the system
clipboard with the received content, so the clipboard in both devices always
have the same content.

This plugin is symmetric to its counterpart in the other device: both have the
same behaviour.