Commit 28797aa1 authored by Bastien Nocera's avatar Bastien Nocera

power: Move the constants to a separate file

parent 3ab97b03
......@@ -10,6 +10,7 @@ libpower_la_SOURCES = \
gsd-power-manager.h \
gsm-inhibitor-flag.h \
gsm-presence-flag.h \
gsd-power-constants.h \
gsd-power-plugin.c
libpower_la_CPPFLAGS = \
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2013 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
/* The blank delay when the screensaver is active */
#define SCREENSAVER_TIMEOUT_BLANK 20 /* seconds */
/* The dim delay when dimming on idle is requested but idle-delay
* is set to "Never" */
#define IDLE_DIM_BLANK_DISABLED_MIN 60 /* seconds */
/* How much smaller than idle-delay the dim delay is */
#define IDLE_DELAY_TO_IDLE_DIM_FRACTION 3
/* The dim delay under which we do not bother dimming */
#define MINIMUM_IDLE_DIM_DELAY 10 /* seconds */
......@@ -36,6 +36,7 @@
#include <libgnome-desktop/gnome-rr.h>
#include <libgnome-desktop/gnome-idle-monitor.h>
#include "gsd-power-constants.h"
#include "gsm-inhibitor-flag.h"
#include "gsm-presence-flag.h"
#include "gpm-common.h"
......@@ -83,8 +84,6 @@
/* Keep this in sync with gnome-shell */
#define SCREENSAVER_FADE_TIME 10 /* seconds */
#define SCREENSAVER_TIMEOUT_BLANK 20 /* seconds */
#define IDLE_DIM_BLANK_DISABLED_MIN 60 /* seconds */
static const gchar introspection_xml[] =
"<node>"
......@@ -2673,11 +2672,11 @@ idle_configure (GsdPowerManager *manager)
if (timeout_dim == 0) {
timeout_dim = IDLE_DIM_BLANK_DISABLED_MIN;
} else {
timeout_dim /= 3;
timeout_dim /= IDLE_DELAY_TO_IDLE_DIM_FRACTION;
/* Don't bother dimming if the idle-delay is
* too low, we'll do that when we bring down the
* screen lock */
if (timeout_dim < 10)
if (timeout_dim < MINIMUM_IDLE_DIM_DELAY)
timeout_dim = 0;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment