diff options
author | Rui Matos <tiagomatos@gmail.com> | 2015-03-26 16:01:04 +0100 |
---|---|---|
committer | Rui Matos <tiagomatos@gmail.com> | 2015-04-13 14:02:02 +0200 |
commit | 75cb96d077c488d9d3e86cc5e9b30587a4ef34cd (patch) | |
tree | 089d0e5495a0791815300c273fb988e4d1959e05 /panels | |
parent | a963a9c3f4c605b9465392774900171c7eb5721b (diff) | |
download | gnome-control-center-75cb96d077c488d9d3e86cc5e9b30587a4ef34cd.tar.gz |
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
Diffstat (limited to 'panels')
-rw-r--r-- | 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 98e89cdf3..5ee8249f1 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); |