diff --git a/gdk/filetransferportal.c b/gdk/filetransferportal.c index 541fd85a24..a658d086a8 100644 --- a/gdk/filetransferportal.c +++ b/gdk/filetransferportal.c @@ -471,6 +471,14 @@ portal_file_deserializer (GdkContentDeserializer *deserializer) g_object_unref (output); } +static void +connection_closed (GDBusConnection *connection, + gboolean remote_peer_vanished, + GError *error) +{ + g_clear_object (&file_transfer_proxy); +} + static void got_proxy (GObject *source, GAsyncResult *result, @@ -509,6 +517,10 @@ got_proxy (GObject *source, portal_file_deserializer, NULL, NULL); + + /* Free the singleton when the connection closes, important for test */ + g_signal_connect (g_dbus_proxy_get_connection (G_DBUS_PROXY (file_transfer_proxy)), + "closed", G_CALLBACK (connection_closed), NULL); } void diff --git a/gdk/gdk.c b/gdk/gdk.c index ae456dc3e2..375f711e79 100644 --- a/gdk/gdk.c +++ b/gdk/gdk.c @@ -148,7 +148,8 @@ static const GDebugKey gdk_debug_keys[] = { { "gl-gles", GDK_DEBUG_GL_GLES }, { "gl-debug", GDK_DEBUG_GL_DEBUG }, { "vulkan-disable", GDK_DEBUG_VULKAN_DISABLE }, - { "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE } + { "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE }, + { "default-settings",GDK_DEBUG_DEFAULT_SETTINGS }, }; #endif diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index 12abe1186d..579f0a755a 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -63,7 +63,8 @@ typedef enum { GDK_DEBUG_GL_GLES = 1 << 16, GDK_DEBUG_GL_DEBUG = 1 << 17, GDK_DEBUG_VULKAN_DISABLE = 1 << 18, - GDK_DEBUG_VULKAN_VALIDATE = 1 << 19 + GDK_DEBUG_VULKAN_VALIDATE = 1 << 19, + GDK_DEBUG_DEFAULT_SETTINGS= 1 << 20 } GdkDebugFlags; extern guint _gdk_debug_flags; diff --git a/gdk/x11/gdkxftdefaults.c b/gdk/x11/gdkxftdefaults.c index cb6c8be2ae..68b5f7d138 100644 --- a/gdk/x11/gdkxftdefaults.c +++ b/gdk/x11/gdkxftdefaults.c @@ -81,13 +81,17 @@ parse_boolean (char *v) } static gboolean -get_boolean_default (Display *dpy, +get_boolean_default (GdkX11Screen *x11_screen, const gchar *option, gboolean *value) { + Display *dpy = GDK_SCREEN_XDISPLAY (x11_screen); gchar *v; gint i; - + + if (GDK_DISPLAY_DEBUG_CHECK (GDK_SCREEN_DISPLAY (x11_screen), DEFAULT_SETTINGS)) + return FALSE; + v = XGetDefault (dpy, "Xft", option); if (v) { @@ -103,12 +107,16 @@ get_boolean_default (Display *dpy, } static gboolean -get_double_default (Display *dpy, +get_double_default (GdkX11Screen *x11_screen, const gchar *option, gdouble *value) { + Display *dpy = GDK_SCREEN_XDISPLAY (x11_screen); gchar *v, *e; - + + if (GDK_DISPLAY_DEBUG_CHECK (GDK_SCREEN_DISPLAY (x11_screen), DEFAULT_SETTINGS)) + return FALSE; + v = XGetDefault (dpy, "Xft", option); if (v) { @@ -126,12 +134,16 @@ get_double_default (Display *dpy, } static gboolean -get_integer_default (Display *dpy, +get_integer_default (GdkX11Screen *x11_screen, const gchar *option, gint *value) { + Display *dpy = GDK_SCREEN_XDISPLAY (x11_screen); gchar *v, *e; - + + if (GDK_DISPLAY_DEBUG_CHECK (GDK_SCREEN_DISPLAY (x11_screen), DEFAULT_SETTINGS)) + return FALSE; + v = XGetDefault (dpy, "Xft", option); if (v) { @@ -149,7 +161,6 @@ get_integer_default (Display *dpy, static void init_xft_settings (GdkX11Screen *x11_screen) { - Display *xdisplay = GDK_SCREEN_XDISPLAY (x11_screen); double dpi_double; gboolean b; @@ -158,21 +169,21 @@ init_xft_settings (GdkX11Screen *x11_screen) x11_screen->xft_init = TRUE; - if (!get_boolean_default (xdisplay, "antialias", &b)) + if (!get_boolean_default (x11_screen, "antialias", &b)) b = TRUE; x11_screen->xft_antialias = b; - if (!get_boolean_default (xdisplay, "hinting", &b)) + if (!get_boolean_default (x11_screen, "hinting", &b)) b = TRUE; x11_screen->xft_hinting = b; - if (!get_integer_default (xdisplay, "hintstyle", &x11_screen->xft_hintstyle)) + if (!get_integer_default (x11_screen, "hintstyle", &x11_screen->xft_hintstyle)) x11_screen->xft_hintstyle = FC_HINT_MEDIUM; - if (!get_integer_default (xdisplay, "rgba", &x11_screen->xft_rgba)) + if (!get_integer_default (x11_screen, "rgba", &x11_screen->xft_rgba)) x11_screen->xft_rgba = FC_RGBA_UNKNOWN; - if (!get_double_default (xdisplay, "dpi", &dpi_double)) + if (!get_double_default (x11_screen, "dpi", &dpi_double)) dpi_double = 96.0; x11_screen->xft_dpi = (int)(0.5 + PANGO_SCALE * dpi_double); diff --git a/gdk/x11/xsettings-client.c b/gdk/x11/xsettings-client.c index 8c309c9227..d43d06a0e5 100644 --- a/gdk/x11/xsettings-client.c +++ b/gdk/x11/xsettings-client.c @@ -489,7 +489,8 @@ check_manager_window (GdkX11Screen *x11_screen, gdk_x11_display_grab (display); - x11_screen->xsettings_manager_window = XGetSelectionOwner (xdisplay, get_selection_atom (x11_screen)); + if (!GDK_DISPLAY_DEBUG_CHECK (display, DEFAULT_SETTINGS)) + x11_screen->xsettings_manager_window = XGetSelectionOwner (xdisplay, get_selection_atom (x11_screen)); if (x11_screen->xsettings_manager_window != 0) XSelectInput (xdisplay, diff --git a/testsuite/a11y/about.txt b/testsuite/a11y/about.txt index bc6376c11b..6fccc8c8aa 100644 --- a/testsuite/a11y/about.txt +++ b/testsuite/a11y/about.txt @@ -2,7 +2,7 @@ window1 "dialog" index: 0 name: About FancyPants - state: active enabled sensitive showing visible + state: enabled sensitive showing visible toolkit: gtk window-type: dialog diff --git a/testsuite/a11y/accessibility-dump.c b/testsuite/a11y/accessibility-dump.c index 96da1af98b..70d31d5f04 100644 --- a/testsuite/a11y/accessibility-dump.c +++ b/testsuite/a11y/accessibility-dump.c @@ -188,7 +188,8 @@ dump_relation_set (GString *string, } static void -dump_state_set (GString *string, +dump_state_set (AtkObject *accessible, + GString *string, guint depth, AtkStateSet *set) { @@ -202,6 +203,10 @@ dump_state_set (GString *string, g_string_append_printf (string, "%*sstate:", depth, ""); for (i = 0; i < ATK_STATE_LAST_DEFINED; i++) { + /* The toplevel active state depends on focus interaction with the WM, so lets ignore it */ + if (ATK_IS_WINDOW (accessible) && i == ATK_STATE_ACTIVE) + continue; + if (atk_state_set_contains_state (set, i)) g_string_append_printf (string, " %s", atk_state_type_get_name (i)); } @@ -694,7 +699,7 @@ dump_accessible (AtkObject *accessible, if (atk_object_get_description (accessible)) g_string_append_printf (string, "%*sdescription: %s\n", depth, "", atk_object_get_description (accessible)); dump_relation_set (string, depth, atk_object_ref_relation_set (accessible)); - dump_state_set (string, depth, atk_object_ref_state_set (accessible)); + dump_state_set (accessible, string, depth, atk_object_ref_state_set (accessible)); dump_attribute_set (string, depth, atk_object_get_attributes (accessible)); if (ATK_IS_COMPONENT (accessible)) diff --git a/testsuite/a11y/accessible-name.txt b/testsuite/a11y/accessible-name.txt index f2274db1e5..fbbeabafee 100644 --- a/testsuite/a11y/accessible-name.txt +++ b/testsuite/a11y/accessible-name.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/actionbar.txt b/testsuite/a11y/actionbar.txt index abd273cb1c..5fec7b6a2f 100644 --- a/testsuite/a11y/actionbar.txt +++ b/testsuite/a11y/actionbar.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/buttons.txt b/testsuite/a11y/buttons.txt index 80a1da91b4..3f9811a23f 100644 --- a/testsuite/a11y/buttons.txt +++ b/testsuite/a11y/buttons.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/calendar.txt b/testsuite/a11y/calendar.txt index f9e6a18c3b..5f80dc7c78 100644 --- a/testsuite/a11y/calendar.txt +++ b/testsuite/a11y/calendar.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/colorchooser.txt b/testsuite/a11y/colorchooser.txt index e8ed90ea87..e18dae502a 100644 --- a/testsuite/a11y/colorchooser.txt +++ b/testsuite/a11y/colorchooser.txt @@ -2,7 +2,7 @@ window1 "dialog" index: 0 name: Select a Color - state: active enabled sensitive showing visible + state: enabled sensitive showing visible toolkit: gtk window-type: dialog diff --git a/testsuite/a11y/combos.txt b/testsuite/a11y/combos.txt index 875b4beb07..be2e8e04dd 100644 --- a/testsuite/a11y/combos.txt +++ b/testsuite/a11y/combos.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/entries.txt b/testsuite/a11y/entries.txt index 1e332697a4..d94dc9a956 100644 --- a/testsuite/a11y/entries.txt +++ b/testsuite/a11y/entries.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/expander.txt b/testsuite/a11y/expander.txt index 863c4ea4f4..07ca46e6fb 100644 --- a/testsuite/a11y/expander.txt +++ b/testsuite/a11y/expander.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/headerbar.txt b/testsuite/a11y/headerbar.txt index 6a933d0110..a0dffd43f1 100644 --- a/testsuite/a11y/headerbar.txt +++ b/testsuite/a11y/headerbar.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/hello-world.txt b/testsuite/a11y/hello-world.txt index a3816eda2e..b9d478e88a 100644 --- a/testsuite/a11y/hello-world.txt +++ b/testsuite/a11y/hello-world.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/iconview.txt b/testsuite/a11y/iconview.txt index 760937982f..98a6acad82 100644 --- a/testsuite/a11y/iconview.txt +++ b/testsuite/a11y/iconview.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/label-static.txt b/testsuite/a11y/label-static.txt index 885522437c..3b9eb4ba04 100644 --- a/testsuite/a11y/label-static.txt +++ b/testsuite/a11y/label-static.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/label.txt b/testsuite/a11y/label.txt index 8f3e2e74b5..a8669ada27 100644 --- a/testsuite/a11y/label.txt +++ b/testsuite/a11y/label.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/link.txt b/testsuite/a11y/link.txt index 4d8ff1ad7e..37ddff5a05 100644 --- a/testsuite/a11y/link.txt +++ b/testsuite/a11y/link.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/listbox.txt b/testsuite/a11y/listbox.txt index ceeff350aa..f69b812c80 100644 --- a/testsuite/a11y/listbox.txt +++ b/testsuite/a11y/listbox.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/lockbutton.txt b/testsuite/a11y/lockbutton.txt index b8968cd386..d3bc163622 100644 --- a/testsuite/a11y/lockbutton.txt +++ b/testsuite/a11y/lockbutton.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/menubutton.txt b/testsuite/a11y/menubutton.txt index 6d4cf5445d..59c99901ad 100644 --- a/testsuite/a11y/menubutton.txt +++ b/testsuite/a11y/menubutton.txt @@ -1,7 +1,7 @@ window1 "frame" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/menubutton2.txt b/testsuite/a11y/menubutton2.txt index e6e16e5b8c..ec6956665b 100644 --- a/testsuite/a11y/menubutton2.txt +++ b/testsuite/a11y/menubutton2.txt @@ -1,7 +1,7 @@ window1 "frame" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/menubutton3.txt b/testsuite/a11y/menubutton3.txt index e6e16e5b8c..ec6956665b 100644 --- a/testsuite/a11y/menubutton3.txt +++ b/testsuite/a11y/menubutton3.txt @@ -1,7 +1,7 @@ window1 "frame" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/meson.build b/testsuite/a11y/meson.build index 01fab478fd..6df0b25b2f 100644 --- a/testsuite/a11y/meson.build +++ b/testsuite/a11y/meson.build @@ -56,6 +56,7 @@ foreach t: a11y_state_tests env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), diff --git a/testsuite/a11y/mnemonic.txt b/testsuite/a11y/mnemonic.txt index 45906ef0eb..ca96c5d50b 100644 --- a/testsuite/a11y/mnemonic.txt +++ b/testsuite/a11y/mnemonic.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/notebook.txt b/testsuite/a11y/notebook.txt index d2e50bf062..5151cea46c 100644 --- a/testsuite/a11y/notebook.txt +++ b/testsuite/a11y/notebook.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/pickers.txt b/testsuite/a11y/pickers.txt index f6971e5bf2..7f457e374a 100644 --- a/testsuite/a11y/pickers.txt +++ b/testsuite/a11y/pickers.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/placeholder-text.txt b/testsuite/a11y/placeholder-text.txt index e24f5fb8d0..c264ae31d0 100644 --- a/testsuite/a11y/placeholder-text.txt +++ b/testsuite/a11y/placeholder-text.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/range.txt b/testsuite/a11y/range.txt index e044e08dc8..68acf81aed 100644 --- a/testsuite/a11y/range.txt +++ b/testsuite/a11y/range.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/scale-drawvalue.txt b/testsuite/a11y/scale-drawvalue.txt index c0f9915470..21877a4601 100644 --- a/testsuite/a11y/scale-drawvalue.txt +++ b/testsuite/a11y/scale-drawvalue.txt @@ -1,7 +1,7 @@ window1 "frame" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/stack.txt b/testsuite/a11y/stack.txt index 5d41385ccd..dfb48d43e7 100644 --- a/testsuite/a11y/stack.txt +++ b/testsuite/a11y/stack.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/text.txt b/testsuite/a11y/text.txt index f873df4a99..771787e00d 100644 --- a/testsuite/a11y/text.txt +++ b/testsuite/a11y/text.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/tooltips.txt b/testsuite/a11y/tooltips.txt index d351486336..cee7fd7cdd 100644 --- a/testsuite/a11y/tooltips.txt +++ b/testsuite/a11y/tooltips.txt @@ -1,7 +1,7 @@ window1 "frame" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/a11y/tree.txt b/testsuite/a11y/tree.txt index 99dec067c4..2a02b53083 100644 --- a/testsuite/a11y/tree.txt +++ b/testsuite/a11y/tree.txt @@ -1,7 +1,7 @@ window1 "window" index: 0 - state: active enabled resizable sensitive showing visible + state: enabled resizable sensitive showing visible toolkit: gtk window-type: normal diff --git a/testsuite/css/change/meson.build b/testsuite/css/change/meson.build index 59a2562710..3637a244a8 100644 --- a/testsuite/css/change/meson.build +++ b/testsuite/css/change/meson.build @@ -12,6 +12,7 @@ test('change', test_change, args: [ '--tap', '-k' ], env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), diff --git a/testsuite/css/meson.build b/testsuite/css/meson.build index 00f54efb2c..237f4732d2 100644 --- a/testsuite/css/meson.build +++ b/testsuite/css/meson.build @@ -14,6 +14,7 @@ test('api', test_api, args: ['--tap', '-k' ], env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), @@ -30,6 +31,7 @@ test('data', test_data, args: ['--tap', '-k' ], env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), diff --git a/testsuite/css/nodes/meson.build b/testsuite/css/nodes/meson.build index 984cca6047..42e7b215dc 100644 --- a/testsuite/css/nodes/meson.build +++ b/testsuite/css/nodes/meson.build @@ -9,6 +9,7 @@ test('nodes', test_nodes, args: [ '--tap', '-k' ], env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), diff --git a/testsuite/css/parser/meson.build b/testsuite/css/parser/meson.build index b378a5e9f3..9e501a0bd2 100644 --- a/testsuite/css/parser/meson.build +++ b/testsuite/css/parser/meson.build @@ -466,6 +466,7 @@ foreach testname : test_data ], env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), diff --git a/testsuite/css/style/bloomfilter-not.nodes b/testsuite/css/style/bloomfilter-not.nodes index ac98aa82c0..52281a1381 100644 --- a/testsuite/css/style/bloomfilter-not.nodes +++ b/testsuite/css/style/bloomfilter-not.nodes @@ -1,4 +1,4 @@ -window.background.solid-csd:dir(ltr) +window.background.csd:dir(ltr) decoration:dir(ltr) headerbar.titlebar:dir(ltr) box.horizontal.start:dir(ltr) diff --git a/testsuite/css/style/meson.build b/testsuite/css/style/meson.build index 3198b85c05..4f4921e946 100644 --- a/testsuite/css/style/meson.build +++ b/testsuite/css/style/meson.build @@ -19,6 +19,7 @@ test('style', test_style, args: [ '--tap', '-k' ], env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), diff --git a/testsuite/css/style/test-css-style.c b/testsuite/css/style/test-css-style.c index 47e80ceacd..6e6a59466e 100644 --- a/testsuite/css/style/test-css-style.c +++ b/testsuite/css/style/test-css-style.c @@ -95,15 +95,35 @@ diff_with_file (const char *file1, return output; } +static char * +fixup_style_differences (const char *str) +{ + GRegex *regex; + char *result; + + /* normalize differences that creep in from hard-to-control environmental influences */ + regex = g_regex_new ("[.]solid-csd", 0, 0, NULL); + result = g_regex_replace_literal (regex, str, -1, 0, ".csd", 0, NULL); + g_regex_unref (regex); + + return result; +} + static void style_context_changed (GtkWidget *window, const char **output) { GtkStyleContext *context; + char *str; context = gtk_widget_get_style_context (window); - *output = gtk_style_context_to_string (context, GTK_STYLE_CONTEXT_PRINT_RECURSE | - GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE); + str = gtk_style_context_to_string (context, GTK_STYLE_CONTEXT_PRINT_RECURSE | + GTK_STYLE_CONTEXT_PRINT_SHOW_STYLE); + + *output = fixup_style_differences (str); + + g_free (str); + g_main_context_wakeup (NULL); } diff --git a/testsuite/gdk/meson.build b/testsuite/gdk/meson.build index d7049af572..36d424ebe1 100644 --- a/testsuite/gdk/meson.build +++ b/testsuite/gdk/meson.build @@ -22,6 +22,7 @@ foreach t : tests args: [ '--tap', '-k' ], env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build index bee40fd32e..f303dd5f79 100644 --- a/testsuite/gsk/meson.build +++ b/testsuite/gsk/meson.build @@ -91,6 +91,7 @@ foreach renderer : renderers join_paths(meson.current_source_dir(), 'compare', test + '.png')], env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), @@ -171,6 +172,7 @@ foreach test : node_parser_tests ], env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), @@ -204,6 +206,7 @@ foreach t : tests args: [ '--tap', '-k' ], env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'GSK_RENDERER=cairo', diff --git a/testsuite/gtk/defaultvalue.c b/testsuite/gtk/defaultvalue.c index 0164107422..cfe9623cf2 100644 --- a/testsuite/gtk/defaultvalue.c +++ b/testsuite/gtk/defaultvalue.c @@ -415,6 +415,19 @@ G_GNUC_END_IGNORE_DEPRECATIONS g_type_class_unref (klass); } +static gboolean +dbind_warning_handler (const char *log_domain, + GLogLevelFlags log_level, + const char *message, + gpointer user_data) +{ + if (strcmp (log_domain, "dbind") == 0 && + log_level == (G_LOG_LEVEL_WARNING|G_LOG_FLAG_FATAL)) + return FALSE; + + return TRUE; +} + int main (int argc, char **argv) { @@ -423,14 +436,16 @@ main (int argc, char **argv) GTestDBus *bus; GMainLoop *loop; gint result; + const char *display, *x_r_d; /* These must be set before before gtk_test_init */ g_setenv ("GIO_USE_VFS", "local", TRUE); g_setenv ("GSETTINGS_BACKEND", "memory", TRUE); g_setenv ("G_ENABLE_DIAGNOSTIC", "0", TRUE); - gtk_test_init (&argc, &argv); - gtk_test_register_all_types(); + /* g_test_dbus_up() helpfully clears these, so we have to re-set it */ + display = g_getenv ("DISPLAY"); + x_r_d = g_getenv ("XDG_RUNTIME_DIR"); /* Create one test bus for all tests, as we have a lot of very small * and quick tests. @@ -438,6 +453,16 @@ main (int argc, char **argv) bus = g_test_dbus_new (G_TEST_DBUS_NONE); g_test_dbus_up (bus); + if (display) + g_setenv ("DISPLAY", display, TRUE); + if (x_r_d) + g_setenv ("XDG_RUNTIME_DIR", x_r_d, TRUE); + + g_test_log_set_fatal_handler (dbind_warning_handler, NULL); + + gtk_test_init (&argc, &argv); + gtk_test_register_all_types(); + otypes = gtk_test_list_all_types (NULL); for (i = 0; otypes[i]; i++) { diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build index e232522841..4255d8817f 100644 --- a/testsuite/gtk/meson.build +++ b/testsuite/gtk/meson.build @@ -94,6 +94,7 @@ foreach t : tests args: [ '--tap', '-k' ], env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'GSK_RENDERER=cairo', @@ -116,6 +117,7 @@ if add_languages('cpp', required: false) args: [ '--tap', '-k' ], env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), @@ -158,6 +160,7 @@ foreach test : focus_chain_tests join_paths(meson.current_source_dir(), 'focus-chain', test[0] + '.' + test[1]) ], env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), diff --git a/testsuite/gtk/objects-finalize.c b/testsuite/gtk/objects-finalize.c index 5ee575bf3b..67a1a8217c 100644 --- a/testsuite/gtk/objects-finalize.c +++ b/testsuite/gtk/objects-finalize.c @@ -101,6 +101,19 @@ test_finalize_object (gconstpointer data) gtk_main(); } +static gboolean +dbind_warning_handler (const char *log_domain, + GLogLevelFlags log_level, + const char *message, + gpointer user_data) +{ + if (strcmp (log_domain, "dbind") == 0 && + log_level == (G_LOG_LEVEL_WARNING|G_LOG_FLAG_FATAL)) + return FALSE; + + return TRUE; +} + int main (int argc, char **argv) { @@ -108,14 +121,15 @@ main (int argc, char **argv) guint n_types = 0, i; GTestDBus *bus; gint result; + const char *display, *x_r_d; /* These must be set before before gtk_test_init */ g_setenv ("GIO_USE_VFS", "local", TRUE); g_setenv ("GSETTINGS_BACKEND", "memory", TRUE); - /* initialize test program */ - gtk_test_init (&argc, &argv); - gtk_test_register_all_types (); + /* g_test_dbus_up() helpfully clears these, so we have to re-set it */ + display = g_getenv ("DISPLAY"); + x_r_d = g_getenv ("XDG_RUNTIME_DIR"); /* Create one test bus for all tests, as we have a lot of very small * and quick tests. @@ -123,6 +137,17 @@ main (int argc, char **argv) bus = g_test_dbus_new (G_TEST_DBUS_NONE); g_test_dbus_up (bus); + if (display) + g_setenv ("DISPLAY", display, TRUE); + if (x_r_d) + g_setenv ("XDG_RUNTIME_DIR", x_r_d, TRUE); + + g_test_log_set_fatal_handler (dbind_warning_handler, NULL); + + /* initialize test program */ + gtk_test_init (&argc, &argv); + gtk_test_register_all_types (); + all_types = gtk_test_list_all_types (&n_types); for (i = 0; i < n_types; i++) diff --git a/testsuite/reftests/meson.build b/testsuite/reftests/meson.build index 9a9845ee1c..71080d6f32 100644 --- a/testsuite/reftests/meson.build +++ b/testsuite/reftests/meson.build @@ -445,6 +445,7 @@ foreach testname : testdata 'GSETTINGS_BACKEND=memory', 'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir), 'GTK_CSD=1', + 'GDK_DEBUG=default-settings', 'G_ENABLE_DIAGNOSTIC=0', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), diff --git a/testsuite/tools/meson.build b/testsuite/tools/meson.build index 4e6a605056..1364a98679 100644 --- a/testsuite/tools/meson.build +++ b/testsuite/tools/meson.build @@ -21,6 +21,7 @@ if bash.found() workdir: meson.current_build_dir(), env: [ 'GIO_USE_VOLUME_MONITOR=unix', 'GSETTINGS_BACKEND=memory', + 'GDK_DEBUG=default-settings', 'GTK_CSD=1', 'G_ENABLE_DIAGNOSTIC=0', 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),