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
This commit is contained in:
parent
0d88e93787
commit
4d5cc9d0bb
@ -1,3 +1,8 @@
|
|||||||
|
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>
|
2002-10-26 Havoc Pennington <hp@pobox.com>
|
||||||
|
|
||||||
* src/xprops.c (meta_prop_get_text_property): new function
|
* src/xprops.c (meta_prop_get_text_property): new function
|
||||||
|
@ -115,10 +115,10 @@ evil_timeout (gpointer data)
|
|||||||
{
|
{
|
||||||
GtkWidget *w;
|
GtkWidget *w;
|
||||||
GtkWidget *c;
|
GtkWidget *c;
|
||||||
|
int t;
|
||||||
|
GtkWidget *parent;
|
||||||
|
|
||||||
w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
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,
|
gtk_widget_set_uposition (w,
|
||||||
g_random_int_range (0,
|
g_random_int_range (0,
|
||||||
@ -126,6 +126,27 @@ evil_timeout (gpointer data)
|
|||||||
g_random_int_range (0,
|
g_random_int_range (0,
|
||||||
gdk_screen_height ()));
|
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);
|
gtk_widget_show_all (w);
|
||||||
|
|
||||||
evil_windows = g_slist_prepend (evil_windows, w);
|
evil_windows = g_slist_prepend (evil_windows, w);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user