Bug 337961

Summary: Klipper freezes for 5-7 seconds when using Ctrl-C on Chrome
Product: [Unmaintained] klipper Reporter: Sudhir Khanger <sudhir>
Component: generalAssignee: Martin Flöser <mgraesslin>
Status: RESOLVED NOT A BUG    
Severity: normal CC: bugs.kde.pistos, furlongm, g111, kde-bugs, krissn, rdieter
Priority: NOR    
Version: 0.9.7   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=446581
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Sudhir Khanger 2014-08-01 18:45:08 UTC
Klipper freezes if I copy anything in Chrome using Ctrl-C. It seems to work fine if text is copied when primary selection is synchronized with clipboard. All other applications seems to not exhibit this behavior.
Comment 1 Martin Flöser 2014-08-11 06:59:42 UTC
what do you mean by klipper freezes? How do you notice that? What do you expect to happen and what is actually happening?
Comment 2 Sudhir Khanger 2014-08-11 12:55:58 UTC
> what do you mean by klipper freezes?

This only happens in Chrome. After selecting text if I press Ctrl-C and then Klipper is not accessible for 5-7 seconds that is nothing happens if I press Ctrl-V or if I click Klipper system icon nothing happens. Click on Klipper system tray icons go unregistered.

> How do you notice that?

Klipper system tray icons does not respond to clicks for 5-7 seconds.

>  What do you expect to happen and what is actually happening?

After selecting text, it should be immediately available to either pasting via Ctrl-V or selecting the text via Klipper system tray icon.
Comment 3 Pistos 2014-09-04 14:32:59 UTC
I am experiencing this exact same behaviour.  I didn't know that you could use Chrome to reproduce, thanks for that information!  This is 100% reproducible for me.  Just select any text in Chromium (version 37.0.2062.94 here), press Ctrl-C, and Klipper becomes unresponsive for 10 to 20 seconds.  Before I knew about the Chrome repro steps, I would see this problem last for sometimes minutes at a time (I guess with other applications besides Chrome?).  I notice that, even though Klipper won't respond to the "show clips" hotkey, or clicking in the systray, when you hover over the Klipper icon, you get the tooltip "Clipboard contents: whatever contents".

This has been a problem for me for a long time, through numerous KDE upgrades and Chromium upgrades.  KDE version 4.12.5 here.
Comment 4 Sudhir Khanger 2014-09-04 14:45:40 UTC
I have recently switched to Plasma 5.0.1 with Frameworks 5.1.0 on Fedora 20. I am unable to reproduce this bug, at least not for a few days I have been trying Plasma 5.
Comment 5 Martin Flöser 2014-09-04 15:16:58 UTC
(In reply to donniezazen from comment #4)
> I have recently switched to Plasma 5.0.1 with Frameworks 5.1.0 on Fedora 20.
> I am unable to reproduce this bug, at least not for a few days I have been
> trying Plasma 5.

thanks, that's important information as it explains why I have not been able to reproduce. It's certainly possible that this bug got fixed with the switch to Qt5 as Qt has a new xcb-based plugin for X11, so the clipboard interaction code is also new.
Comment 6 Pistos 2014-09-05 02:19:53 UTC
KDE 5 is not available in Gentoo yet.  In the meantime, I have turned to [Parcellite](http://parcellite.sourceforge.net/), which seems to be an adequate substitute.
Comment 7 Marcus Furlong 2014-09-05 12:10:46 UTC
Seeing the exact same behavior for a long time. See #238084
Comment 8 Marcus Furlong 2014-09-10 08:41:51 UTC
Another issue (possibly the same?) is copying and pasting images between google docs. It doesn't work with klipper running, but works fine without klipper.
Comment 9 Krzysztof Nowicki 2015-02-17 06:42:33 UTC
Not sure if this is related, but I'm experiencing Plasma panel freezes caused by Klipper. This happens  when I select some text in any window. This causes the whole panel to freeze for several seconds. Below is a stack trace captured during the freeze:

Thread 1 (Thread 0x7ff268cd2840 (LWP 10220)):
#0  0x00007ff2726ec363 in select () from /lib64/libc.so.6
#1  0x00007ff2689d7f8b in QXcbClipboard::waitForClipboardEvent(unsigned int, int, int, bool) () from /usr/lib64/qt5/plugins/platforms/libqxcb.so
#2  0x00007ff2689dcdc2 in QXcbClipboard::getSelection(unsigned int, unsigned int, unsigned int, unsigned int) () from /usr/lib64/qt5/plugins/platforms/libqxcb.so
#3  0x00007ff2689dd2d3 in QXcbClipboardMime::formats_sys() const () from /usr/lib64/qt5/plugins/platforms/libqxcb.so
#4  0x00007ff2730983db in QInternalMimeData::formats() const () from /usr/lib64/libQt5Gui.so.5
#5  0x00007ff1780944f0 in checkClipData (selectionMode=true, this=0x7ff2775f06b0) at /var/tmp/portage/kde-plasma/plasma-workspace-5.2.0-r1/work/plasma-workspace-5.2.0/klipper/klipper.cpp:690
#6  Klipper::newClipData (this=0x7ff2775f06b0, mode=<optimized out>) at /var/tmp/portage/kde-plasma/plasma-workspace-5.2.0-r1/work/plasma-workspace-5.2.0/klipper/klipper.cpp:596
#7  0x00007ff1780994a3 in Klipper::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=0x7ff2775f06b0, _c=<optimized out>, _id=<optimized out>, _a=0x7fffad797660)
    at /var/tmp/portage/kde-plasma/plasma-workspace-5.2.0-r1/work/plasma-workspace-5.2.0_build/klipper/moc_klipper.cpp:213
#8  0x00007ff272d46c9d in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
#9  0x00007ff2733812fb in QClipboard::changed(QClipboard::Mode) () from /usr/lib64/libQt5Gui.so.5
#10 0x00007ff2689f1267 in QXcbConnection::handleXcbEvent(xcb_generic_event_t*) () from /usr/lib64/qt5/plugins/platforms/libqxcb.so
#11 0x00007ff268a10b13 in QXcbConnection::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib64/qt5/plugins/platforms/libqxcb.so
#12 0x00007ff272d2e737 in QObject::event(QEvent*) () from /usr/lib64/libQt5Core.so.5
#13 0x00007ff27391080c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#14 0x00007ff273911172 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#15 0x00007ff272d9542d in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#16 0x00007ff272d95656 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/libQt5Core.so.5
#17 0x00007ff272da49c9 in ?? () from /usr/lib64/libQt5Core.so.5
#18 0x00007ff26ff922bc in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#19 0x00007ff26ff925c8 in ?? () from /usr/lib64/libglib-2.0.so.0
#20 0x00007ff26ff926d1 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#21 0x00007ff272d9b9ed in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#22 0x00007ff272d92a4b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#23 0x00007ff272d976e8 in QCoreApplication::exec() () from /usr/lib64/libQt5Core.so.5
#24 0x00007ff275144953 in main (argc=2, argv=<optimized out>) at /var/tmp/portage/kde-plasma/plasma-workspace-5.2.0-r1/work/plasma-workspace-5.2.0/shell/main.cpp:150

The OS is Gentoo with Plasma 5.2 and KF 5.6.
Comment 10 Martin Kho 2015-05-13 09:24:28 UTC
HI,

I'm using plasma 5.3 (and kf5-plasma 5.9) on Fedora 22 final TC3 and experience sometimes 5-7 second freezes. Besides this issue selecting some text in Konsole (15.04) sometimes doesn't get copied. I did as follows:
In Konsole exec:
1. ps ax
2. select some text with left mouse button
3. past text from clipboard to the command line
4. repeat steps 2 and 3 6 to 7 times (may be more)

HTH

Martin Kho
Comment 11 Sudhir Khanger 2015-05-13 11:06:59 UTC
> I'm using plasma 5.3 (and kf5-plasma 5.9) on Fedora 22 final TC3 and experience sometimes 5-7 second freezes.

When you say Klipper freezes does that mean you are not able to open Klipper widget via left-mouse click on the widget in the system tray or via  keyboard shortcut like Ctlr+Alt+V on KDE 4 (should be same on Plasma 5).

In my case the freeze happened if I hit Ctrl+C in Chrome on a selected text to copy it to the clipboard. have you noticed any triggers?

About you second question. I have selected option "Synchronize contents of the clipboard and the selection" which copies everything to Klipper that is gets selected. Konsole also has Settings>Edit Current Profile>Mouse>Copy and paste settings that might be worth taking a look.
Comment 12 Martin Kho 2015-05-13 12:54:56 UTC
(In reply to donniezazen from comment #11)
> > I'm using plasma 5.3 (and kf5-plasma 5.9) on Fedora 22 final TC3 and experience sometimes 5-7 second freezes.
> 
> When you say Klipper freezes does that mean you are not able to open Klipper
> widget via left-mouse click on the widget in the system tray or via 
> keyboard shortcut like Ctlr+Alt+V on KDE 4 (should be same on Plasma 5)

No, not only.  plasmashell freezes totally during the 5-7 seconds.

> 
> In my case the freeze happened if I hit Ctrl+C in Chrome on a selected text
> to copy it to the clipboard. have you noticed any triggers?

I only used the mouse, as I descriped in my steps.

> 
> About you second question. I have selected option "Synchronize contents of
> the clipboard and the selection" which copies everything to Klipper that is
> gets selected. Konsole also has Settings>Edit Current Profile>Mouse>Copy and
> paste settings that might be worth taking a look.

It now takes more repeat steps (step 4, comment #10) to get the misses/freeze. Btw. there are also one or more empty  entries in the list.

Martin Kho
Comment 13 Rex Dieter 2015-05-13 15:00:57 UTC
FYI, chome does... odd things when selecting stuff in the address/url bar, and I'm aware of at least one issue/bug open with them about it already (I'll see if I can find it and reference it here)
Comment 14 Rex Dieter 2015-05-13 15:05:20 UTC
The one I had in mind,
https://code.google.com/p/chromium/issues/detail?id=424111
Comment 15 Sudhir Khanger 2015-05-13 15:23:00 UTC
@Martin Kho I think plasmashell freezes might not be related to Klipper. Fedora Plasma had those freezes as long as I remember. See this bug report https://bugs.kde.org/show_bug.cgi?id=338999

I don't like empty entries as they break my workflow but Martin Gräßlin mentioned somewhere that those are by design. Apparently there a patch now. https://bugs.kde.org/show_bug.cgi?id=192922

@Rex As you can see in my last comment #10. I can no longer replicate that issue. It works fine for me at least.
Comment 16 Rex Dieter 2015-05-13 15:31:28 UTC
fwiw, chrome is still problematic for me using google-chome-stable-41.0.2272.101
Comment 17 Sudhir Khanger 2015-05-13 15:36:53 UTC
The current stable version of Google Chrome is 42.0.2311.152 (64-bit). The best way to tell if the bug still exist is try the dev build.

http://googlechromereleases.blogspot.in/2015/05/stable-channel-update.html
Comment 18 Martin Kho 2015-05-13 15:56:57 UTC
Well, my issues aren't indeed not related to Chrome. This is, because I'm not using it, at leased not in F22 ;-)
@donniezazen: I'm not sure if it's bug #338999. My issue 'solves' itself after 5-7 seconds, I've to do nothing just wait and everything is fine again.
Comment 19 Martin Kho 2015-05-14 09:13:05 UTC
Hi,

Today there were a lot of updates ( kf5* (5.10), xorg, libinput) and now I can't reproduce my issues anymore. 

Martin Kho
Comment 20 g111 2015-10-24 18:19:00 UTC
I cannot reproduce the problem in kubuntu 15.10. So IMHO this report can be closed?
Comment 21 g111 2015-10-24 18:22:24 UTC
Oh, maybe it has to do with the graphics card/driver you are using Bug 238084 that I had reported some time ago is not reproducable by me anymore, too. Maybe because I am using intel graphics (onchip intel i7 sandy  bridge) and before this a nvidia card?
Comment 22 Sudhir Khanger 2015-10-24 19:38:21 UTC
Kubuntu 15.10 uses Clipboard widget. That's a separate thing from Klipper app.

This problem is clearly reproducible on Kubuntu 14.04 with Klipper app.
Comment 23 Martin Flöser 2015-10-25 10:25:22 UTC
(In reply to Sudhir Khanger from comment #22)
> This problem is clearly reproducible on Kubuntu 14.04 with Klipper app.

14.04 is nowadays rather irrelevant (won't see any bug fixes from us any more). The question is whether with the Klipper app it's reproducable in a recent release.
Comment 24 Sudhir Khanger 2015-10-30 07:09:24 UTC
(In reply to Martin Gräßlin from comment #23)
> ...
> more). The question is whether with the Klipper app it's reproducable in a
> recent release.

There is no reason for me to use Klipper app after the release of Clipboard widget. Before that like I said in comment #4 that I didn't see any freezes in Plasma 5.

I am sort of have to use CopyQ because it properly copies Chrome links and ignores empty spaces both of which are important for my work flow.

I am closing this as I haven't been able to reproduce it for a long time.