diff -Nru xsettings-kde-0.12.3/debian/changelog xsettings-kde-0.12.3/debian/changelog --- xsettings-kde-0.12.3/debian/changelog 2012-02-14 10:24:46.000000000 +0100 +++ xsettings-kde-0.12.3/debian/changelog 2012-05-22 13:41:53.000000000 +0200 @@ -1,3 +1,12 @@ +xsettings-kde (0.12.3-0ubuntu2.1) precise-proposed; urgency=low + + * Add kubuntu_busy_wait.patch removing busy waiting for events, which is + more elegantly hidden away in XNextEvent. This removes xsettings from + powertop listing pretty much as it is now in fact only doing stuff when + there is stuff to be done. (LP: #1002811) + + -- Harald Sitter Tue, 22 May 2012 13:40:29 +0200 + xsettings-kde (0.12.3-0ubuntu2) precise; urgency=low * Fix kubuntu_gtktheme.patch diff -Nru xsettings-kde-0.12.3/debian/patches/kubuntu_busy_wait.patch xsettings-kde-0.12.3/debian/patches/kubuntu_busy_wait.patch --- xsettings-kde-0.12.3/debian/patches/kubuntu_busy_wait.patch 1970-01-01 01:00:00.000000000 +0100 +++ xsettings-kde-0.12.3/debian/patches/kubuntu_busy_wait.patch 2012-05-22 13:40:13.000000000 +0200 @@ -0,0 +1,31 @@ +From: Harald Sitter +Subject: Remove pointless sleep() + The IM support patch from [1], imported into Mageia in [2] adds a + conditional sleep() call when the infinite loop runs into an empty + event queue which is bound to happen quite a few times. + . + This introduces pointless code and pointless wake ups as the used + XNextEvent function blocks on an empty queue anyway [3], thus + rendering the manual sleep() call superfluous. + . + [1] https://bugzilla.redhat.com/show_bug.cgi?id=727822 + [2] http://svnweb.mageia.org/soft?view=revision&revision=2011 + [3] http://tronche.com/gui/x/xlib/event-handling/manipulating-event-queue/XNextEvent.html + +Index: xsettings-kde-0.12.3/xsettings-kde.c +=================================================================== +--- xsettings-kde-0.12.3.orig/xsettings-kde.c 2012-05-22 00:01:21.000000000 +0200 ++++ xsettings-kde-0.12.3/xsettings-kde.c 2012-05-22 00:02:25.209293378 +0200 +@@ -529,11 +529,7 @@ + int i; + + while (1) { +- if (!XPending(xev->display)) { +- sleep(2); +- continue; +- } +- XNextEvent (xev->display, &xevent); ++ XNextEvent (xev->display, &xevent); + + for (i = 0 ; i < max_display ; i++) { + if (xsettings_manager_process_event (managers[i], &xevent)) diff -Nru xsettings-kde-0.12.3/debian/patches/series xsettings-kde-0.12.3/debian/patches/series --- xsettings-kde-0.12.3/debian/patches/series 2012-02-10 13:01:07.000000000 +0100 +++ xsettings-kde-0.12.3/debian/patches/series 2012-05-22 13:40:13.000000000 +0200 @@ -1,2 +1,3 @@ kubuntu_gtktheme.patch kubuntu_kde4_dir.patch +kubuntu_busy_wait.patch