summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorFlorian Müllner <fmuellner@gnome.org>2012-09-18 18:33:07 +0200
committerMatthias Clasen <mclasen@redhat.com>2012-09-25 18:46:12 -0400
commit0628bd3291aad936b6b553366600590cca360bfa (patch)
tree667b6e8ad8a92d9f57cea3cfc1a82f8ee39e15cf /src/option.c
parent22b15e87d3a3cf70f4ba62172d8aecaaf6c146dd (diff)
util: Add an option to request dialogs being modal
As WMs cannot open windows themselves, Mutter uses zenity to open "Force Quit" dialogs for unresponsive windows; as those are strongly tied to the corresponding window, it makes sense to make them modal (in particular when attaching them to their parent). https://bugzilla.gnome.org/show_bug.cgi?id=684322
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/option.c b/src/option.c
index ee0e9c2..ba4691d 100644
--- a/src/option.c
+++ b/src/option.c
@@ -44,6 +44,7 @@ static gboolean zenity_general_dialog_no_markup;
static gint zenity_general_timeout_delay;
static gchar *zenity_general_ok_button;
static gchar *zenity_general_cancel_button;
+static gboolean zenity_general_modal;
/* Calendar Dialog Options */
static gboolean zenity_calendar_active;
@@ -211,6 +212,15 @@ static GOptionEntry general_options[] = {
N_("TEXT")
},
{
+ "modal",
+ '\0',
+ G_OPTION_FLAG_NOALIAS,
+ G_OPTION_ARG_NONE,
+ &zenity_general_modal,
+ N_("Set the modal hint"),
+ NULL
+ },
+ {
NULL
}
};
@@ -1287,6 +1297,7 @@ zenity_general_pre_callback (GOptionContext *context,
zenity_general_dialog_no_wrap = FALSE;
zenity_general_dialog_no_markup = FALSE;
zenity_general_timeout_delay = -1;
+ zenity_general_modal = FALSE;
return TRUE;
}
@@ -1524,6 +1535,7 @@ zenity_general_post_callback (GOptionContext *context,
results->data->timeout_delay = zenity_general_timeout_delay;
results->data->ok_label = zenity_general_ok_button;
results->data->cancel_label = zenity_general_cancel_button;
+ results->data->modal = zenity_general_modal;
return TRUE;
}