Everything KDE from git master on top of Fedora 37. STEPS TO REPRODUCE 0. Use the Plasma Wayland session 1. Configure Spectacle to use "After taking screenshot: Copy to clipboard" setting 2. Take a screenshot OBSERVED RESULT The screenshot is not copied to the clipboard automatically. EXPECTED RESULT The screenshot is copied to the clipboard automatically. ADDITIONAL INFORMATION 1. This works as expected on X11 2. On Wayland, clicking the "Copy" button in the toolbar does work to copy the screenshot to the clipboard manually 3. This used to work on Wayland a week or two ago, but I bisected both Spectacle and KWin back to December 1 and it was still broken there, so I guess something somewhere else regressed to make this happen?
Same issue on Arch Linux. The most suspicious recent changes are a bunch of KF5 updates (5.101 -> 5.102) on 01-14, but I'm not sure if that is the reason.
The culprit seems to be https://invent.kde.org/frameworks/kguiaddons/-/commit/3984732e007e71632a525d89227fdfe94fa037ad. With KGuiAddons v5.101.0 the issue disappears, and git bisect found this commit.
(In reply to hexchain from comment #2) > The culprit seems to be > https://invent.kde.org/frameworks/kguiaddons/-/commit/ > 3984732e007e71632a525d89227fdfe94fa037ad. > > With KGuiAddons v5.101.0 the issue disappears, and git bisect found this > commit. Interesting. Perhaps we should we say that this is actually a KSystemClipboard bug?
Seems for me the delay settings play a role - no delay no copy is happening - 1s or more copy works
I've updated my system and can't reproduce anymore.
If you can - could you give more detailed steps, maybe there is a difference in my testing? - provide me the output of `WAYLAND_DEBUG=1 spectacle` of taking jsut one screenshot with that setting.
(In reply to David Redondo from comment #6) > - could you give more detailed steps, maybe there is a difference in my > testing? Launch spectacle -rbc either through the console or through a shortcut I've created through system settings. Select a rectangular region, I get a notification saying it's copied to the clipboard, it's not copied to the clipboard. - provide me the output of `WAYLAND_DEBUG=1 spectacle` of taking jsut one screenshot with that setting. Attached is the output of `WAYLAND_DEBUG=1 spectacle -rbc` Launching Spectacle gui, taking a screenshot, and manually clicking the copy to clipboard button works. Launching Spectacle with the background option + copy to clipboard + any other option except the rectangular one works. Launching Spectacle with the background option + copy to clipboard + rectangular selection, doesn't work.
Created attachment 155375 [details] logs for running spectacle -rcb
Can confirm that it is now working for me with current git master as well.
Created attachment 155396 [details] Wayland debug logs for running spectacle -ircb My steps are the same as in #c7 (except I added an additional -i flag). Here is my Wayland debug logs.
Even with these commands copies happen for me. From your wayland logs it looks to me like you wouldn't have https://invent.kde.org/frameworks/kguiaddons/-/commit/0fbb0aa524adbd077b2ba7716218d4c6f042bed0 but it should be included in 5.102: Window is hidden (surface destroyed) but data_device is used [3695470.952] wl_pointer@26.frame() [3695471.113] -> xdg_toplevel@41.destroy() [3695471.116] -> xdg_surface@40.destroy() [3695471.122] -> wl_display@1.sync(new id wl_callback@53) [3695471.124] -> wl_surface@37.destroy() [3695471.614] -> org_kde_plasma_surface@34.destroy() [3695472.136] -> wl_shm_pool@51.destroy() [3695472.141] -> wl_buffer@52.destroy() [3695472.696] -> wl_shm_pool@42.destroy() [3695472.700] -> wl_buffer@43.destroy() [3695472.732] -> wl_data_device_manager@9.create_data_source(new id wl_data_source@54) [3695474.937] -> wl_data_source@54.offer("application/x-qt-image") [3695474.941] -> wl_data_source@54.offer("x-kde-force-image-copy") [3695474.942] -> wl_data_source@54.offer("image/png") [...] [3695474.956] -> wl_data_device@10.set_selection(wl_data_source@54, 26798) [1946768.478] wl_pointer@20.frame() [1946770.191] -> xdg_toplevel@35.destroy() [1946770.208] -> xdg_surface@34.destroy() [1946770.227] -> wl_display@1.sync(new id wl_callback@50) [1946770.240] -> wl_surface@31.destroy() [1946770.673] -> org_kde_plasma_surface@28.destroy() [1946771.791] -> wl_shm_pool@46.destroy() [1946771.812] -> wl_buffer@47.destroy() [1946772.872] -> wl_shm_pool@41.destroy() [1946772.886] -> wl_buffer@42.destroy() [1946774.022] -> wl_shm_pool@36.destroy() [1946774.042] -> wl_buffer@37.destroy() [1946775.128] -> wl_shm_pool@44.destroy() [1946775.144] -> wl_buffer@45.destroy() [1946775.967] -> wl_data_device_manager@9.create_data_source(new id wl_data_source@51) [1946776.192] -> wl_data_source@51.offer("application/x-qt-image") [1946776.223] -> wl_data_source@51.offer("x-kde-force-image-copy") [1946776.232] -> wl_data_source@51.offer("image/png") [...] [1946776.407] -> wl_data_device@10.set_selection(wl_data_source@51, 27682) While on my machine happens what I would expect, no window so data_control is used: [1118803.392] wl_keyboard@3.key(2533, 3267142, 28, 1) [1118804.192] -> xdg_toplevel@40.destroy() [1118804.213] -> xdg_surface@39.destroy() [1118804.256] -> wl_display@1.sync(new id wl_callback@77) [1118804.272] -> wl_surface@35.destroy() [1118804.324] -> org_kde_kwin_appmenu@69.release() [1118806.243] -> zwlr_data_control_manager_v1@24.create_data_source(new id zwlr_data_control_source_v1@81) [1118806.261] -> zwlr_data_control_source_v1@81.offer("application/x-qt-image") [1118806.269] -> zwlr_data_control_source_v1@81.offer("x-kde-force-image-copy") [1118806.413] -> zwlr_data_control_source_v1@81.offer("image/png") [...] [1118806.586] -> zwlr_data_control_device_v1@27.set_selection(zwlr_data_control_source_v1@81) I am bit of a loss at the moment why it would happen
I honestly have no idea. It still happens even after removing ~/.config/spectaclerc. Are you running everything from git master? Could it be something other than KGuiAddons?
*** Bug 464478 has been marked as a duplicate of this bug. ***
*** Bug 464506 has been marked as a duplicate of this bug. ***
Tried to do some debugging on this issue with some added output to KGuiAddons: https://gist.github.com/hexchain/06e71deb8b29f661fee646fe0096a499 Spectacle prints the following output after a screenshot is taken (and nothing is copied to the clipboard): kb enter using normal mechanism fw: QWindow(0x0) , fw->isVisible: false , keyboard has focus: true kb leave If I remove the whole "if" block of the "normal mechanism", Spectacle is then able to copy the image to the clipboard. With WAYLAND_DEBUG the output also matches what you expected in #c11.
Having same problem on Arch (Kernel 6.1.8, Plasma version 5.26.5, Kde Frameworks 5.102.0) and downgrading to kguiaddons 5.101 seem to be working partially (meaning that it now copy to clipboard but using spectacle -brc it just never stop the command until i use ^C)
I reproduced now with the release version of spectacle compared to the rewritten version.
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kguiaddons/-/merge_requests/90
Git commit dcb254dc6b4e5b76e04a5ee8b4db8177aff10d29 by David Edmundson, on behalf of David Redondo. Committed on 27/01/2023 at 22:26. Pushed by davidedmundson into branch 'master'. waylandclipboard: roundtrip to get accurate focus state The current approach is too complicated and not correct anyway. To summarize QGuiApplication::focusWindow is delayed so the focus watcher was introduced, however when the window is hidden and setMimeData called before Wayland events have been processed, then focusWatcher is naturally out of sync, so the check was complicated to work around this state. However the same issue arises when the window is deleted before calling setMimeData. Instead of introducing more complicated checks and workaround roundtrip so the focusWatcher state is up to date before setting the clipboard. FIXED-IN: 5.103 M +8 -3 src/systemclipboard/waylandclipboard.cpp https://invent.kde.org/frameworks/kguiaddons/commit/dcb254dc6b4e5b76e04a5ee8b4db8177aff10d29
Git commit e195913d37f8ff79a14351c029952830394e7057 by Fushan Wen, on behalf of David Redondo. Committed on 29/01/2023 at 05:14. Pushed by fusionfuture into branch 'cherry-pick-dcb254dc'. waylandclipboard: roundtrip to get accurate focus state The current approach is too complicated and not correct anyway. To summarize QGuiApplication::focusWindow is delayed so the focus watcher was introduced, however when the window is hidden and setMimeData called before Wayland events have been processed, then focusWatcher is naturally out of sync, so the check was complicated to work around this state. However the same issue arises when the window is deleted before calling setMimeData. Instead of introducing more complicated checks and workaround roundtrip so the focusWatcher state is up to date before setting the clipboard. FIXED-IN: 5.103 (cherry picked from commit dcb254dc6b4e5b76e04a5ee8b4db8177aff10d29) M +8 -3 src/systemclipboard/waylandclipboard.cpp https://invent.kde.org/frameworks/kguiaddons/commit/e195913d37f8ff79a14351c029952830394e7057
*** Bug 464997 has been marked as a duplicate of this bug. ***
After updating to kguiaddons 5.103, issue is still present. KDE Plasma 5.26.90 Wayland session, Arch Linux kernel 6.1.11-arch1-1.
My mistake. I forgot I had put kguidaddons in IgnorePkg and it did not actually update when I ran a full system upgrade. 5.103 fixes the issue.