mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-05 05:18:00 +02:00
suppress lid change event on startup
Suppress lid change event on startup. Otherwise, gnome-power-manager picks up a "lid is closed" change event when dk-p gets D-BUS activated, and thus immediately suspends the machine on startup. http://bugs.freedesktop.org/show_bug.cgi?id=22574 https://launchpad.net/bugs/385135
This commit is contained in:
parent
269fc33a3b
commit
db98ba1cb6
1 changed files with 11 additions and 1 deletions
|
|
@ -102,6 +102,7 @@ gboolean
|
|||
dkp_daemon_set_lid_is_closed (DkpDaemon *daemon, gboolean lid_is_closed)
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
static gboolean initialized = FALSE;
|
||||
|
||||
g_return_val_if_fail (DKP_IS_DAEMON (daemon), FALSE);
|
||||
|
||||
|
|
@ -112,7 +113,16 @@ dkp_daemon_set_lid_is_closed (DkpDaemon *daemon, gboolean lid_is_closed)
|
|||
}
|
||||
|
||||
/* save */
|
||||
g_signal_emit (daemon, signals[CHANGED_SIGNAL], 0);
|
||||
if (!initialized) {
|
||||
/* Do not emit an event on startup. Otherwise, e. g.
|
||||
* gnome-power-manager would pick up a "lid is closed" change
|
||||
* event when dk-p gets D-BUS activated, and thus would
|
||||
* immediately suspend the machine on startup. FD#22574 */
|
||||
egg_debug ("not emitting lid change event for daemon startup");
|
||||
initialized = TRUE;
|
||||
} else {
|
||||
g_signal_emit (daemon, signals[CHANGED_SIGNAL], 0);
|
||||
}
|
||||
daemon->priv->lid_is_closed = lid_is_closed;
|
||||
ret = TRUE;
|
||||
out:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue