Re: [gpm] little chance in 50-no-critical-on-ac.patch (ubuntu)



On Mon, 2006-02-20 at 20:52 +0100, Micha�Arnauts wrote:
> This is what is in CVS:
> (in battery_status_changed_primary)
> 
> 	if (warning_type == GPM_WARNING_ACTION) {
> 		gpm_tray_icon_notify (GPM_TRAY_ICON (manager->priv->tray_icon),
> 				      5000,
> 				      _("Critical action"),
> 				      NULL,
> 				      _("The battery is below the critical level and "
> 					"this computer is about to shutdown."));
> 		/* wait 10 seconds for user-panic */
> 		g_usleep (1000 * 1000 * 10);

So you're block the the UI of g-p-m here? That's bad, isn't it?
Shouldn't you be using g_timeout_add() instead and have some kind of
state machine?

    David




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]