summaryrefslogtreecommitdiff
path: root/src/shell-wm.c
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2013-08-17 17:42:39 +0200
committerGiovanni Campagna <gcampagn@redhat.com>2013-08-20 12:03:13 +0200
commit02224bb5fe14baaed46853587dec88a64107a1a6 (patch)
treeb78d364c27d5a4188178e587970a69aa3a8ab9a2 /src/shell-wm.c
parentc37c4d8c6d3bd830fb02fd13239610ad1e958630 (diff)
Add a confirmation dialog for display changes
Unfortunately, display configuration can and does fail, due to unspecified HW constraints, drivers bugs, unsupported exotic configurations or just bad luck. So when the user makes a change in the control center, show a dialog asking him if it looks OK, and revert back after 20 seconds otherwise. https://bugzilla.gnome.org/show_bug.cgi?id=706208
Diffstat (limited to 'src/shell-wm.c')
-rw-r--r--src/shell-wm.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/shell-wm.c b/src/shell-wm.c
index 08aceb7f..20f101ed 100644
--- a/src/shell-wm.c
+++ b/src/shell-wm.c
@@ -27,6 +27,7 @@ enum
KILL_SWITCH_WORKSPACE,
KILL_WINDOW_EFFECTS,
FILTER_KEYBINDING,
+ CONFIRM_DISPLAY_CHANGE,
LAST_SIGNAL
};
@@ -124,6 +125,13 @@ shell_wm_class_init (ShellWMClass *klass)
g_signal_accumulator_true_handled, NULL, NULL,
G_TYPE_BOOLEAN, 1,
META_TYPE_KEY_BINDING);
+ shell_wm_signals[CONFIRM_DISPLAY_CHANGE] =
+ g_signal_new ("confirm-display-change",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL, NULL,
+ G_TYPE_NONE, 0);
}
void
@@ -219,6 +227,20 @@ shell_wm_completed_destroy (ShellWM *wm,
meta_plugin_destroy_completed (wm->plugin, actor);
}
+/**
+ * shell_wm_complete_display_change:
+ * @wm: the ShellWM
+ * @ok: if the new configuration was OK
+ *
+ * The plugin must call this after the user responded to the confirmation dialog.
+ */
+void
+shell_wm_complete_display_change (ShellWM *wm,
+ gboolean ok)
+{
+ meta_plugin_complete_display_change (wm->plugin, ok);
+}
+
void
_shell_wm_kill_switch_workspace (ShellWM *wm)
{
@@ -287,6 +309,12 @@ _shell_wm_filter_keybinding (ShellWM *wm,
return rv;
}
+void
+_shell_wm_confirm_display_change (ShellWM *wm)
+{
+ g_signal_emit (wm, shell_wm_signals[CONFIRM_DISPLAY_CHANGE], 0);
+}
+
/**
* shell_wm_new:
* @plugin: the #MetaPlugin