[gnome-control-center/gnome-3-14] display: Close the dialog when the RR configuration changes
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gnome-3-14] display: Close the dialog when the RR configuration changes
- Date: Mon, 13 Apr 2015 12:09:09 +0000 (UTC)
commit 75cb96d077c488d9d3e86cc5e9b30587a4ef34cd
Author: Rui Matos <tiagomatos gmail com>
Date: Thu Mar 26 16:01:04 2015 +0100
display: Close the dialog when the RR configuration changes
We assume that the RR configuration is valid in various callbacks from
both our modal dialogs which doesn't hold if there's an hotplug while
a dialog is open (e.g. monitor is plugged/unplugged).
Closing the dialog in that case seems the right thing to do since it
would be operating on an outdated view of the world otherwise and
likely end up crashing.
https://bugzilla.gnome.org/show_bug.cgi?id=655041
panels/display/cc-display-panel.c | 17 +++++------------
1 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index 98e89cd..5ee8249 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -391,6 +391,9 @@ on_screen_changed (CcDisplayPanel *panel)
GtkSizeGroup *sizegroup;
GList *sorted_outputs = NULL, *l;
+ if (priv->dialog)
+ gtk_dialog_response (GTK_DIALOG (priv->dialog), GTK_RESPONSE_NONE);
+
gnome_rr_screen_refresh (priv->screen, NULL);
current = gnome_rr_config_new_current (priv->screen, NULL);
@@ -1569,12 +1572,7 @@ show_arrange_displays_dialog (GtkButton *button,
response = gtk_dialog_run (GTK_DIALOG (priv->dialog));
if (response == GTK_RESPONSE_ACCEPT)
apply_current_configuration (panel);
- else if (response == GTK_RESPONSE_NONE)
- {
- /* panel is being destroyed */
- return;
- }
- else
+ else if (response != GTK_RESPONSE_NONE)
{
/* re-read the previous configuration */
on_screen_changed (panel);
@@ -2299,12 +2297,7 @@ show_setup_dialog (CcDisplayPanel *panel)
apply_current_configuration (panel);
}
- else if (response == GTK_RESPONSE_NONE)
- {
- /* panel is being destroyed */
- return;
- }
- else
+ else if (response != GTK_RESPONSE_NONE)
{
/* changes cancelled, so re-read the current configuration */
on_screen_changed (panel);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]