Commit 3d7d2f24 authored by Matthias Clasen's avatar Matthias Clasen

Work towards succeeding make check under Wayland

Skip tests that don't work under Wayland, such as tests for GtkPlug
and GtkSocket.
parent aa3bf0ac
......@@ -23,6 +23,10 @@
*/
#include <gtk/gtk.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
static void
test_click_expander (void)
{
......@@ -65,6 +69,7 @@ test_click_content_widget (void)
GtkWidget *entry = gtk_entry_new ();
gboolean expanded;
gboolean simsuccess;
gtk_container_add (GTK_CONTAINER (expander), entry);
gtk_container_add (GTK_CONTAINER (gtk_bin_get_child (GTK_BIN (window))), expander);
gtk_expander_set_expanded (GTK_EXPANDER (expander), TRUE);
......@@ -89,7 +94,16 @@ main (int argc,
char *argv[])
{
gtk_test_init (&argc, &argv);
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) ;
return 0; /* gtk_test functions don't work well elsewhere */
#else
return 0;
#endif
g_test_add_func ("/expander/click-expander", test_click_expander);
g_test_add_func ("/expander/click-content-widget", test_click_content_widget);
return g_test_run();
}
......@@ -19,6 +19,12 @@
#include <string.h>
#include <gtk/gtk.h>
#include <gtk/gtkunixprint.h>
#ifdef GDK_WINDOWING_X11
#include <gtk/gtkx.h>
#endif
#ifdef GDK_WINDOWING_WAYLAND
#include "gdk/wayland/gdkwayland.h"
#endif
typedef struct
{
......@@ -407,7 +413,24 @@ test_type (gconstpointer data)
/* These rely on a d-bus session bus */
if (g_type_is_a (type, GTK_TYPE_MOUNT_OPERATION))
return;
/* Backend-specific */
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_DISPLAY (gdk_display_get_default ())) ;
else
#endif
if (g_type_is_a (type, GTK_TYPE_PLUG) ||
g_type_is_a (type, GTK_TYPE_SOCKET))
return;
#ifdef GDK_WINDOWING_WAYLAND
if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ()))
{
if (g_type_is_a (type, GTK_TYPE_STATUS_ICON))
return;
}
#endif
klass = g_type_class_ref (type);
if (g_type_is_a (type, GTK_TYPE_SETTINGS))
......
......@@ -375,34 +375,35 @@ test_hide_titlebar_when_maximized (void)
gtk_main ();
#ifdef GDK_WINDOWING_X11
{
Atom type;
gint format;
gulong nitems;
gulong bytes_after;
gulong *hide = NULL;
XGetWindowProperty (gdk_x11_get_default_xdisplay (),
GDK_WINDOW_XID (gtk_widget_get_window (window)),
gdk_x11_get_xatom_by_name ("_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED"),
0,
G_MAXLONG,
False,
XA_CARDINAL,
&type,
&format,
&nitems,
&bytes_after,
(guchar **) &hide);
g_assert_cmpint (type, !=, None);
g_assert_cmpint (type, ==, XA_CARDINAL);
g_assert_cmpint (format, ==, 32);
g_assert_cmpint (nitems, ==, 1);
g_assert_cmpint (hide[0], ==, 1);
XFree (hide);
}
if (GDK_IS_X11_SCREEN (gtk_widget_get_screen (window)))
{
Atom type;
gint format;
gulong nitems;
gulong bytes_after;
gulong *hide = NULL;
XGetWindowProperty (gdk_x11_get_default_xdisplay (),
GDK_WINDOW_XID (gtk_widget_get_window (window)),
gdk_x11_get_xatom_by_name ("_GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED"),
0,
G_MAXLONG,
False,
XA_CARDINAL,
&type,
&format,
&nitems,
&bytes_after,
(guchar **) &hide);
g_assert_cmpint (type, !=, None);
g_assert_cmpint (type, ==, XA_CARDINAL);
g_assert_cmpint (format, ==, 32);
g_assert_cmpint (nitems, ==, 1);
g_assert_cmpint (hide[0], ==, 1);
XFree (hide);
}
#endif
gtk_widget_destroy (window);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment