Bug 490803

Summary: Copying time to clipboard doesn't work on Wayland
Product: [Plasma] plasmashell Reporter: linux-aarhus <fh>
Component: Digital ClockAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: 4wy78uwh, nate, p.r.worrall, postix
Priority: NOR Keywords: wayland
Version: 6.1.3   
Target Milestone: 1.0   
Platform: Manjaro   
OS: Linux   
URL: https://forum.manjaro.org/t/copy-time-date-to-clipboard-does-not-work-on-wayland/166027
Latest Commit: Version Fixed In: 6.2.0
Sentry Crash Report:

Description linux-aarhus 2024-07-25 04:18:50 UTC
SUMMARY
Righclicking digital clock to copy date and time 

STEPS TO REPRODUCE
1. use a wayland session
2. rightclick digital clock
3. navigate to copy to clipboard
4. select an entry with left mouse button
5. open clipboard

OBSERVED RESULT

Clipboard is empty 


EXPECTED RESULT

Clipboard should contain a value from the displayed list

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2
Kernel Version: 6.10.0-4-MANJARO (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen Threadripper PRO 5945WX 12-Cores
Memory: 62,6 GiB of RAM
Graphics Processor: AMD Radeon RX 7900 XTX
Manufacturer: LENOVO
Product Name: 30E000GMMT
System Version: ThinkStation P620

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2024-07-25 18:58:25 UTC
Can reproduce.
Comment 2 Bug Janitor Service 2024-08-02 10:02:13 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/6195
Comment 3 David Redondo 2024-08-06 13:09:07 UTC
Git commit 31018c000bbad5dc3b263b7f452b0795dd153ceb by David Redondo.
Committed on 06/08/2024 at 12:54.
Pushed by davidre into branch 'master'.

wayland: Check serial instead of focus for changing selections

Clients can have valid reasons to change the selection when the
same user action that also caused the selection request
to lose keyboard focus. This is notbaly the case for menus
created from a Plasma panel which itself will not take focus
but when clicking on action it only triggers after the menu
is closed.
This also matches what weston and sway do.

M  +3    -7    autotests/integration/helper/copy.cpp
M  +7    -0    autotests/integration/xwayland_selections_test.cpp
M  +7    -7    autotests/wayland/client/test_datadevice.cpp
M  +1    -1    autotests/wayland/client/test_selection.cpp
M  +10   -10   autotests/wayland/client/test_wayland_seat.cpp
M  +4    -4    autotests/wayland/server/test_datacontrol_interface.cpp
M  +1    -1    src/wayland/datadevice.cpp
M  +1    -1    src/wayland/datadevice.h
M  +1    -1    src/wayland/primaryselectiondevice_v1.cpp
M  +1    -1    src/wayland/primaryselectiondevice_v1.h
M  +24   -26   src/wayland/seat.cpp
M  +2    -2    src/wayland/seat.h
M  +5    -2    src/wayland/seat_p.h
M  +3    -2    src/xwayland/clipboard.cpp
M  +3    -2    src/xwayland/primary.cpp

https://invent.kde.org/plasma/kwin/-/commit/31018c000bbad5dc3b263b7f452b0795dd153ceb