gnome-settings-daemon r674 - in trunk: . plugins/xrandr
- From: federico svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-settings-daemon r674 - in trunk: . plugins/xrandr
- Date: Tue, 27 Jan 2009 21:33:44 +0000 (UTC)
Author: federico
Date: Tue Jan 27 21:33:44 2009
New Revision: 674
URL: http://svn.gnome.org/viewvc/gnome-settings-daemon?rev=674&view=rev
Log:
bgo545115 (RANDR) - Factor out function to apply the stored configuration at startup
2009-01-27 Federico Mena Quintero <federico novell com>
http://bugzilla.gnome.org/show_bug.cgi?id=545115 - Ask for
confirmation, with a timeout, after changing the RANDR
configuration for if we leave the user with an unusable display.
This also handles the case where the machine may crash after
changing the configuration; the old/known-good configuration will
be restored when the user restarts his session.
Refactor:
* plugins/xrandr/gsd-xrandr-manager.c
(apply_stored_configuration_at_startup): Factor out the logic to
apply the stored configuration at startup.
(gsd_xrandr_manager_start): Use the function above.
Signed-off-by: Federico Mena Quintero <federico novell com>
Modified:
trunk/ChangeLog
trunk/plugins/xrandr/gsd-xrandr-manager.c
Modified: trunk/plugins/xrandr/gsd-xrandr-manager.c
==============================================================================
--- trunk/plugins/xrandr/gsd-xrandr-manager.c (original)
+++ trunk/plugins/xrandr/gsd-xrandr-manager.c Tue Jan 27 21:33:44 2009
@@ -1121,12 +1121,27 @@
start_or_stop_icon (manager);
}
+static void
+apply_stored_configuration_at_startup (GsdXrandrManager *manager)
+{
+ GError *my_error;
+
+ my_error = NULL;
+ if (!gnome_rr_config_apply_stored (manager->priv->rw_screen, &my_error)) {
+ if (my_error) {
+ if (!g_error_matches (my_error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
+ error_message (manager, _("Could not apply the stored configuration for monitors"), my_error, NULL);
+
+ g_error_free (my_error);
+ }
+ }
+
+}
+
gboolean
gsd_xrandr_manager_start (GsdXrandrManager *manager,
GError **error)
{
- GError *my_error;
-
g_debug ("Starting xrandr manager");
gnome_settings_profile_start (NULL);
@@ -1163,15 +1178,7 @@
gdk_error_trap_pop ();
}
- my_error = NULL;
- if (!gnome_rr_config_apply_stored (manager->priv->rw_screen, &my_error)) {
- if (my_error) {
- if (!g_error_matches (my_error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
- error_message (manager, _("Could not apply the stored configuration for monitors"), my_error, NULL);
-
- g_error_free (my_error);
- }
- }
+ apply_stored_configuration_at_startup (manager);
gdk_window_add_filter (gdk_get_default_root_window(),
(GdkFilterFunc)event_filter,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]