Bug 487340

Summary: window focus and clipboard act flaky
Product: [Plasma] kwin Reporter: Aleksandar Kostadinov <akostadinov>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: kde, nate
Priority: NOR    
Version First Reported In: 6.0.4   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Aleksandar Kostadinov 2024-05-21 21:39:37 UTC
SUMMARY
I observe flaky behavior of window focus and clipboard. I file this as a single bug because both things I will describe are related to switching windows so are likely related.

Often when swithing to an existing konsole window with the mouse or Alt+Tab, the cursor in the terminal appears hollow and pasting with middle mouse click does not work no matter how many times I click with the mouse inside the window.

Only when I press a keyboard button, the cursor becomes filled and now I can paste with a middle mouse click.

Then switching between Firefox (125.0.3 in wayland mode), selecting a line, doesn't set clipboard content. I have to try more than once sometimes until the text is copied. I have selected the option in clipboard "keep the selection and clipboard the same". 

STEPS TO REPRODUCE
1. Open Firefox and Konsole
2. Switch to Firefox window and select text with the mouse
3. switch to Konsole window and middle click to paste text

OBSERVED RESULT
1. sometimes selected text in Firefox doesn't reach clipboard, more attempts to select needed
2. often first need to press a keyboard key before I can middle-click paste into konsole

EXPECTED RESULT
1. Selected text should always reach clipboard
2. I should be able to just click Konsole window to bring focus to it and middle-click paste without the need to press a keyboard button

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.8.9-300.fc40.x86_64 (64-bit)
(available in About System)
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0
Graphics: Radeon 780M Graphics

ADDITIONAL INFORMATION
I have no idea how to debug this. I wanted to see like in earlier plasma versions, to choose between software renderer and OpenGL, I can't see that option here though.

So I understand the bug report is not very useful unless you can reproduce it, but then I assume you would have fixed it already if you had it in your system, because it is not really tolerable... or maybe that's just me. Anyway if you tell me how can I provide more useful debug information, I'll gladly do.
Comment 1 David Edmundson 2024-06-04 08:57:13 UTC
We cannot reproduce. 

Some useful things to do:
 -  killall plasmashell (which owns the clipboard manager) and see if that changes things
 - from krunner type 'kwin debug console'. There is a tab for clipboard. middle click paste is called "primary selection"

 - if this yields nothing, running both firefox and konsole with 'WAYLAND_DEBUG=1 konsole  |& grep primary' will show what each app is getting and trying to do
Comment 2 Aleksandar Kostadinov 2024-06-04 17:04:56 UTC
How about debugging this switching focus issue? I'm almost sure these are related. Clicking konsole windows to no avail until I press a keyboard key.
Comment 3 Bug Janitor Service 2024-06-19 03:47:11 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Aleksandar Kostadinov 2024-06-26 09:38:57 UTC
Just upgraded to 6.1 I'll check if things got improved especially related to https://security.stackexchange.com/a/98149/8618
Comment 5 Bug Janitor Service 2024-07-11 03:47:07 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Bug Janitor Service 2024-07-26 03:46:17 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!