gnome-screensaver r1576 - in trunk: . src
- From: mccann svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-screensaver r1576 - in trunk: . src
- Date: Fri, 16 Jan 2009 20:01:10 +0000 (UTC)
Author: mccann
Date: Fri Jan 16 20:01:10 2009
New Revision: 1576
URL: http://svn.gnome.org/viewvc/gnome-screensaver?rev=1576&view=rev
Log:
2009-01-16 William Jon McCann <jmccann redhat com>
* src/gs-listener-dbus.c (do_introspect):
* src/gs-listener-dbus.h:
* src/gs-monitor.c (_gs_monitor_update_from_prefs),
(disconnect_watcher_signals), (connect_watcher_signals):
* src/gs-watcher-x11.c (gs_watcher_set_property),
(gs_watcher_get_property), (gs_watcher_class_init),
(start_idle_watcher), (stop_idle_watcher),
(_gs_watcher_reset_state):
* src/gs-watcher.h:
Remove power notice signal.
Modified:
trunk/ChangeLog
trunk/src/gs-listener-dbus.c
trunk/src/gs-listener-dbus.h
trunk/src/gs-monitor.c
trunk/src/gs-watcher-x11.c
trunk/src/gs-watcher.h
Modified: trunk/src/gs-listener-dbus.c
==============================================================================
--- trunk/src/gs-listener-dbus.c (original)
+++ trunk/src/gs-listener-dbus.c Fri Jan 16 20:01:10 2009
@@ -227,15 +227,6 @@
}
void
-gs_listener_emit_power_notice (GSListener *listener,
- gboolean in_effect)
-{
- g_return_if_fail (listener != NULL);
-
- send_dbus_boolean_signal (listener, "SessionPowerManagementIdleChanged", in_effect);
-}
-
-void
gs_listener_emit_auth_request_begin (GSListener *listener)
{
g_return_if_fail (listener != NULL);
@@ -1338,9 +1329,6 @@
" <signal name=\"SessionIdleChanged\">\n"
" <arg name=\"new_value\" type=\"b\"/>\n"
" </signal>\n"
- " <signal name=\"SessionPowerManagementIdleChanged\">\n"
- " <arg name=\"new_value\" type=\"b\"/>\n"
- " </signal>\n"
" <signal name=\"AuthenticationRequestBegin\">\n"
" </signal>\n"
" <signal name=\"AuthenticationRequestEnd\">\n"
Modified: trunk/src/gs-listener-dbus.h
==============================================================================
--- trunk/src/gs-listener-dbus.h (original)
+++ trunk/src/gs-listener-dbus.h Fri Jan 16 20:01:10 2009
@@ -81,8 +81,6 @@
gboolean gs_listener_is_inhibited (GSListener *listener);
void gs_listener_emit_auth_request_begin (GSListener *listener);
void gs_listener_emit_auth_request_end (GSListener *listener);
-void gs_listener_emit_power_notice (GSListener *listener,
- gboolean in_effect);
G_END_DECLS
Modified: trunk/src/gs-monitor.c
==============================================================================
--- trunk/src/gs-monitor.c (original)
+++ trunk/src/gs-monitor.c Fri Jan 16 20:01:10 2009
@@ -129,36 +129,6 @@
}
static gboolean
-watcher_power_notice_cb (GSWatcher *watcher,
- gboolean in_effect,
- GSMonitor *monitor)
-{
- gboolean inhibited;
- gboolean handled;
-
- gs_debug ("Power notice signal detected: %d", in_effect);
-
- inhibited = gs_listener_is_inhibited (monitor->priv->listener);
-
- handled = FALSE;
- if (in_effect) {
- if (! inhibited) {
- /* send signal */
- handled = TRUE;
- }
- } else {
- /* send signal */
- handled = TRUE;
- }
-
- if (handled) {
- gs_listener_emit_power_notice (monitor->priv->listener, in_effect);
- }
-
- return handled;
-}
-
-static gboolean
watcher_idle_notice_cb (GSWatcher *watcher,
gboolean in_effect,
GSMonitor *monitor)
@@ -348,7 +318,6 @@
idle_detection_enabled = TRUE;
gs_watcher_set_timeout (monitor->priv->watcher, monitor->priv->prefs->timeout);
- gs_watcher_set_power_timeout (monitor->priv->watcher, monitor->priv->prefs->power_timeout);
gs_watcher_set_enabled (monitor->priv->watcher, idle_detection_enabled);
/* in the case where idle detection is reenabled we may need to
@@ -397,7 +366,6 @@
{
g_signal_handlers_disconnect_by_func (monitor->priv->watcher, watcher_idle_cb, monitor);
g_signal_handlers_disconnect_by_func (monitor->priv->watcher, watcher_idle_notice_cb, monitor);
- g_signal_handlers_disconnect_by_func (monitor->priv->watcher, watcher_power_notice_cb, monitor);
}
static void
@@ -407,8 +375,6 @@
G_CALLBACK (watcher_idle_cb), monitor);
g_signal_connect (monitor->priv->watcher, "idle-notice-changed",
G_CALLBACK (watcher_idle_notice_cb), monitor);
- g_signal_connect (monitor->priv->watcher, "power-notice-changed",
- G_CALLBACK (watcher_power_notice_cb), monitor);
}
static void
Modified: trunk/src/gs-watcher-x11.c
==============================================================================
--- trunk/src/gs-watcher-x11.c (original)
+++ trunk/src/gs-watcher-x11.c Fri Jan 16 20:01:10 2009
@@ -48,17 +48,14 @@
/* settings */
guint enabled : 1;
guint timeout;
- guint power_timeout;
guint delta_notice_timeout;
/* state */
guint active : 1;
guint idle : 1;
guint idle_notice : 1;
- guint power_notice : 1;
GSIdleMonitor *idle_monitor;
- guint power_id;
guint notice_id;
guint idle_id;
@@ -69,14 +66,12 @@
enum {
IDLE_CHANGED,
IDLE_NOTICE_CHANGED,
- POWER_NOTICE_CHANGED,
LAST_SIGNAL
};
enum {
PROP_0,
PROP_TIMEOUT,
- PROP_POWER_TIMEOUT
};
static guint signals [LAST_SIGNAL] = { 0, };
@@ -131,20 +126,6 @@
}
}
-void
-gs_watcher_set_power_timeout (GSWatcher *watcher,
- guint timeout)
-{
- g_return_if_fail (GS_IS_WATCHER (watcher));
-
- if (watcher->priv->power_timeout != timeout) {
- watcher->priv->power_timeout = timeout;
-
- /* restart the timers if necessary */
- gs_watcher_reset (watcher);
- }
-}
-
static void
gs_watcher_set_property (GObject *object,
guint prop_id,
@@ -159,9 +140,6 @@
case PROP_TIMEOUT:
gs_watcher_set_timeout (self, g_value_get_uint (value));
break;
- case PROP_POWER_TIMEOUT:
- gs_watcher_set_power_timeout (self, g_value_get_uint (value));
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -182,9 +160,6 @@
case PROP_TIMEOUT:
g_value_set_uint (value, self->priv->timeout);
break;
- case PROP_POWER_TIMEOUT:
- g_value_set_uint (value, self->priv->power_timeout);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -220,16 +195,6 @@
gs_marshal_BOOLEAN__BOOLEAN,
G_TYPE_BOOLEAN,
1, G_TYPE_BOOLEAN);
- signals [POWER_NOTICE_CHANGED] =
- g_signal_new ("power-notice-changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GSWatcherClass, power_notice_changed),
- NULL,
- NULL,
- gs_marshal_BOOLEAN__BOOLEAN,
- G_TYPE_BOOLEAN,
- 1, G_TYPE_BOOLEAN);
g_object_class_install_property (object_class,
PROP_TIMEOUT,
@@ -240,43 +205,11 @@
G_MAXUINT,
600000,
G_PARAM_READWRITE|G_PARAM_CONSTRUCT));
- g_object_class_install_property (object_class,
- PROP_POWER_TIMEOUT,
- g_param_spec_uint ("power-timeout",
- NULL,
- NULL,
- 10000,
- G_MAXUINT,
- 60000,
- G_PARAM_READWRITE|G_PARAM_CONSTRUCT));
g_type_class_add_private (klass, sizeof (GSWatcherPrivate));
}
static gboolean
-_gs_watcher_set_session_power_notice (GSWatcher *watcher,
- gboolean in_effect)
-{
- gboolean res;
-
- res = FALSE;
-
- if (in_effect != watcher->priv->power_notice) {
-
- g_signal_emit (watcher, signals [POWER_NOTICE_CHANGED], 0, in_effect, &res);
- if (res) {
- gs_debug ("Changing power notice state: %d", in_effect);
-
- watcher->priv->power_notice = in_effect;
- } else {
- gs_debug ("Power notice signal not handled: %d", in_effect);
- }
- }
-
- return res;
-}
-
-static gboolean
_gs_watcher_set_session_idle_notice (GSWatcher *watcher,
gboolean in_effect)
{
@@ -323,17 +256,6 @@
}
static gboolean
-on_power_timeout (GSIdleMonitor *monitor,
- guint id,
- gboolean condition,
- GSWatcher *watcher)
-{
- gboolean res;
- res = _gs_watcher_set_session_power_notice (watcher, condition);
- return res;
-}
-
-static gboolean
on_notice_timeout (GSIdleMonitor *monitor,
guint id,
gboolean condition,
@@ -371,13 +293,6 @@
g_return_val_if_fail (watcher != NULL, FALSE);
g_return_val_if_fail (GS_IS_WATCHER (watcher), FALSE);
- g_debug ("GSWatcher: adding power watch %d", watcher->priv->power_timeout);
- watcher->priv->power_id
- = gs_idle_monitor_add_watch (watcher->priv->idle_monitor,
- watcher->priv->power_timeout,
- (GSIdleMonitorWatchFunc)on_power_timeout,
- watcher);
-
notice_timeout = watcher->priv->timeout - watcher->priv->delta_notice_timeout;
g_debug ("GSWatcher: adding notice watch %d", notice_timeout);
watcher->priv->notice_id
@@ -408,10 +323,6 @@
gs_idle_monitor_remove_watch (watcher->priv->idle_monitor,
watcher->priv->notice_id);
}
- if (watcher->priv->power_id > 0) {
- gs_idle_monitor_remove_watch (watcher->priv->idle_monitor,
- watcher->priv->power_id);
- }
if (watcher->priv->idle_id > 0) {
gs_idle_monitor_remove_watch (watcher->priv->idle_monitor,
watcher->priv->idle_id);
@@ -437,7 +348,6 @@
{
watcher->priv->idle = FALSE;
watcher->priv->idle_notice = FALSE;
- watcher->priv->power_notice = FALSE;
}
static gboolean
Modified: trunk/src/gs-watcher.h
==============================================================================
--- trunk/src/gs-watcher.h (original)
+++ trunk/src/gs-watcher.h Fri Jan 16 20:01:10 2009
@@ -46,8 +46,6 @@
gboolean (* idle_changed) (GSWatcher *watcher,
gboolean is_idle);
- gboolean (* power_notice_changed)(GSWatcher *watcher,
- gboolean in_effect);
gboolean (* idle_notice_changed) (GSWatcher *watcher,
gboolean in_effect);
} GSWatcherClass;
@@ -64,8 +62,6 @@
gboolean gs_watcher_get_active (GSWatcher *watcher);
void gs_watcher_set_timeout (GSWatcher *watcher,
guint timeout);
-void gs_watcher_set_power_timeout(GSWatcher *watcher,
- guint timeout);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]