Bug 201587 - Causes ~1 wakeup per second when idle
Summary: Causes ~1 wakeup per second when idle
Status: RESOLVED FIXED
Alias: None
Product: klipper
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Esben Mose Hansen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-26 22:12 UTC by Jonathan Thomas
Modified: 2009-09-04 11:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Disable timer when it is not necessary (1.01 KB, patch)
2009-09-03 21:29 UTC, Jakub Stachowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Thomas 2009-07-26 22:12:11 UTC
Version:            (using KDE 4.2.98)
OS:                Linux
Installed from:    Ubuntu Packages

Originally reported by a user at https://launchpad.net/bugs/301338

Klipper compiled against XFixes still causes 0.8 - 1.0 wakeups per second, even though it is not supposed to do any polling.

ldd /usr/bin/klipper shows that it is indeed linked against libXFixes.
Comment 1 Jakub Stachowski 2009-09-03 21:29:08 UTC
Created attachment 36670 [details]
Disable timer when it is not necessary

Cause of the problem being fixed: klipper sets up a timer to check if there were too many clipboard changes in last second (overflow timer). It is enabled all the time, no matter if someone actually uses the clipboard or not.

Fix: enable timer only after a clipboard change (if it is not yet enabled). 
When the timer fires, do all checks as usual and disable it. Timer handler 
resets overflow count to 0 so it is not possible that an overflow will be 
missed because of this patch.
Comment 2 Esben Mose Hansen 2009-09-04 08:21:47 UTC
Patch looks good to me. Will test it today, and apply.
Comment 3 Esben Mose Hansen 2009-09-04 11:05:46 UTC
SVN commit 1019658 by esben:

Disable overflow timer when it is not needed, elimating a wakeup per second in klipper.
Patch by Jakub Stachowski
BUG: 201587


 M  +4 -1      klipper.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1019658
Comment 4 Esben Mose Hansen 2009-09-04 11:06:37 UTC
Sincere thanks to the reporter and patch submitted :)