summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-02-08 06:22:24 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-02-08 06:22:24 +0000
commitced833fdfc548c646f9273795b4147037922f2ae (patch)
tree98ae898b6c28c09a43558463a0dcbd1c5ce8af06
parent51d9f9dce63404f6c74a15d874a105726fdc95f4 (diff)
downloadmetacity-ced833fdfc548c646f9273795b4147037922f2ae.tar.gz
add modal dialog test
2002-02-08 Havoc Pennington <hp@pobox.com> * src/tools/metacity-window-demo.c (menu_items): add modal dialog test
-rw-r--r--ChangeLog4
-rw-r--r--src/tools/metacity-window-demo.c21
2 files changed, 25 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index bcafd750..7babea3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2002-02-08 Havoc Pennington <hp@pobox.com>
+ * src/tools/metacity-window-demo.c (menu_items): add modal dialog test
+
+2002-02-08 Havoc Pennington <hp@pobox.com>
+
* src/window.c (meta_window_show): when mapping a window with
struts, invalidate the work areas it's on. Should fix at least
part of the problem with windows maximizing over panels.
diff --git a/src/tools/metacity-window-demo.c b/src/tools/metacity-window-demo.c
index 9e873716..a0ac6572 100644
--- a/src/tools/metacity-window-demo.c
+++ b/src/tools/metacity-window-demo.c
@@ -185,6 +185,26 @@ dialog_cb (gpointer callback_data,
}
static void
+modal_dialog_cb (gpointer callback_data,
+ guint callback_action,
+ GtkWidget *widget)
+{
+ GtkWidget *dialog;
+
+ dialog = gtk_message_dialog_new (GTK_WINDOW (callback_data),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_CLOSE,
+ "Here is a MODAL dialog");
+
+ set_gtk_window_type (GTK_WINDOW (dialog), "_NET_WM_WINDOW_TYPE_MODAL_DIALOG");
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ gtk_widget_destroy (dialog);
+}
+
+static void
utility_cb (gpointer callback_data,
guint callback_action,
GtkWidget *widget)
@@ -420,6 +440,7 @@ static GtkItemFactoryEntry menu_items[] =
{ "/_Windows", NULL, NULL, 0, "<Branch>" },
{ "/Windows/tearoff", NULL, NULL, 0, "<Tearoff>" },
{ "/Windows/_Dialog", "<control>d", dialog_cb, 0, NULL },
+ { "/Windows/_Modal dialog", NULL, modal_dialog_cb, 0, NULL },
{ "/Windows/_Utility", "<control>u", utility_cb, 0, NULL },
{ "/Windows/_Splashscreen", "<control>s", splashscreen_cb, 0, NULL },
{ "/Windows/_Top dock", NULL, dock_cb, DOCK_TOP, NULL },