← Back to team overview

dx-packages team mailing list archive

[Bug 645130] Re: notify-osd busy polling consumes CPU and drains battery

 

** Changed in: notify-osd (Ubuntu)
     Assignee: (unassigned) => Mirco Müller (macslow)

** No longer affects: notify-osd

-- 
You received this bug notification because you are a member of DX
Packages, which is subscribed to notify-osd in Ubuntu.
Matching subscriptions: dx-packages
https://bugs.launchpad.net/bugs/645130

Title:
  notify-osd busy polling consumes CPU and drains battery

Status in The Ubuntu Power Consumption Project:
  Fix Released
Status in “notify-osd” package in Ubuntu:
  Fix Released

Bug description:
  notify-osd does busy polling when displaying a notification.
  Function bubble_show() is busy polling redraw_handler and
  pointer_update at 60Hz.

  The code should wait for motion notify events only in the area
  surrounding the notification area and only then handle updates rather
  than spinning on a 60hz poll.

          // FIXME: do nasty busy-polling rendering in the drawing-area
          priv->draw_handler_id = g_timeout_add (1000/FPS,
                                                 (GSourceFunc) redraw_handler,
                                                 self);

          // FIXME: read out current mouse-pointer position every 1/25 second
          priv->pointer_update_id = g_timeout_add (1000/FPS,
                                                   (GSourceFunc) pointer_update,
                                                   self);

  The above code is running two sets of 60Hz polls and could be at least
  combined since they run at the same rate to be wasteful in polled
  mode. However, it should be fixed correctly not to poll in the first
  place.

  To observe this fault, strace notify-osd and observe the insane amount
  of poll() calls.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-power-consumption/+bug/645130/+subscriptions