summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-10-26 21:56:50 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-10-26 21:56:50 +0000
commit4d5cc9d0bb02091b104d60e7930e572745db3717 (patch)
treefe9f0960884e64727f275e6cc8f783bb61b4343a
parent0d88e937876bf2527c967863d6dc8e8d451cf2f6 (diff)
downloadmetacity-4d5cc9d0bb02091b104d60e7930e572745db3717.tar.gz
make windows randomly transient for each other
2002-10-26 Havoc Pennington <hp@pobox.com> * src/wm-tester/main.c (evil_timeout): make windows randomly transient for each other http://bugzilla.gnome.org/show_bug.cgi?id=96928
-rw-r--r--ChangeLog5
-rw-r--r--src/wm-tester/main.c27
2 files changed, 29 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index a4decf6f..2106a02b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2002-10-26 Havoc Pennington <hp@pobox.com>
+ * src/wm-tester/main.c (evil_timeout): make windows randomly
+ transient for each other http://bugzilla.gnome.org/show_bug.cgi?id=96928
+
+2002-10-26 Havoc Pennington <hp@pobox.com>
+
* src/xprops.c (meta_prop_get_text_property): new function
(meta_prop_get_wm_hints): new function
(meta_prop_get_class_hint): new function
diff --git a/src/wm-tester/main.c b/src/wm-tester/main.c
index ce419faa..e56d6606 100644
--- a/src/wm-tester/main.c
+++ b/src/wm-tester/main.c
@@ -93,7 +93,7 @@ evil_timeout (gpointer data)
int len;
int create_count;
int destroy_count;
-
+
len = g_slist_length (evil_windows);
if (len > 35)
@@ -115,16 +115,37 @@ evil_timeout (gpointer data)
{
GtkWidget *w;
GtkWidget *c;
+ int t;
+ GtkWidget *parent;
w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- c = gtk_button_new_with_label ("Evil Window!");
- gtk_container_add (GTK_CONTAINER (w), c);
gtk_widget_set_uposition (w,
g_random_int_range (0,
gdk_screen_width ()),
g_random_int_range (0,
gdk_screen_height ()));
+
+ parent = NULL;
+
+ /* set transient for random window (may create all kinds of weird cycles) */
+ if (len > 0)
+ {
+ t = g_random_int_range (- (len / 3), len);
+ if (t >= 0)
+ {
+ parent = g_slist_nth_data (evil_windows, t);
+
+ if (parent != NULL)
+ gtk_window_set_transient_for (GTK_WINDOW (w), GTK_WINDOW (parent));
+ }
+ }
+
+ if (parent != NULL)
+ c = gtk_button_new_with_label ("Evil Transient!");
+ else
+ c = gtk_button_new_with_label ("Evil Window!");
+ gtk_container_add (GTK_CONTAINER (w), c);
gtk_widget_show_all (w);