summaryrefslogtreecommitdiff
path: root/tests/testgtk.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testgtk.c')
-rw-r--r--tests/testgtk.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 8d9447ec85..d7d63ff530 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -4801,27 +4801,30 @@ create_cursors (GtkWidget *widget)
NULL);
#ifdef GDK_WINDOWING_X11
- hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
-
- label = gtk_label_new ("Cursor Theme : ");
- gtk_widget_set_halign (label, GTK_ALIGN_START);
- gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
- gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
-
- entry = gtk_entry_new ();
- gtk_entry_set_text (GTK_ENTRY (entry), "default");
- gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, TRUE, 0);
-
- size = gtk_spin_button_new_with_range (1.0, 64.0, 1.0);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (size), 24.0);
- gtk_box_pack_start (GTK_BOX (hbox), size, TRUE, TRUE, 0);
-
- g_signal_connect (entry, "changed",
- G_CALLBACK (change_cursor_theme), hbox);
- g_signal_connect (size, "changed",
- G_CALLBACK (change_cursor_theme), hbox);
+ if (GDK_IS_X11_DISPLAY (gtk_widget_get_display (vbox)))
+ {
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
+
+ label = gtk_label_new ("Cursor Theme : ");
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+ gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
+
+ entry = gtk_entry_new ();
+ gtk_entry_set_text (GTK_ENTRY (entry), "default");
+ gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, TRUE, 0);
+
+ size = gtk_spin_button_new_with_range (1.0, 64.0, 1.0);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (size), 24.0);
+ gtk_box_pack_start (GTK_BOX (hbox), size, TRUE, TRUE, 0);
+
+ g_signal_connect (entry, "changed",
+ G_CALLBACK (change_cursor_theme), hbox);
+ g_signal_connect (size, "changed",
+ G_CALLBACK (change_cursor_theme), hbox);
+ }
#endif
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);