From 75a19577e511baaea0ee0fd9e998ec8bfba16573 Mon Sep 17 00:00:00 2001 From: Michael Schumacher Date: Mon, 9 Dec 2024 21:55:04 +0100 Subject: [PATCH] app/tests: use gtk_test_widget_send_key instead of gdk_test_simulate_key Two tests were consistently timing out before this change: save-and-export and ui. The gdk_test_simulate_key documentation mentions that gtk_test_widget_send_key is the right approach for most testing purposes. With this change, save-and-export started working for me, whereas ui now fails properly - investigating this failure was the original point of the change. --- app/tests/gimp-app-test-utils.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/app/tests/gimp-app-test-utils.c b/app/tests/gimp-app-test-utils.c index 681e64cbd7..d2f9fd000d 100644 --- a/app/tests/gimp-app-test-utils.c +++ b/app/tests/gimp-app-test-utils.c @@ -284,16 +284,9 @@ else } #else /* ! GDK_WINDOWING_QUARTZ */ - gdk_test_simulate_key (gtk_widget_get_window (widget), - -1, -1, /*x, y*/ - keyval, - 0 /*modifiers*/, - GDK_KEY_PRESS); - gdk_test_simulate_key (gtk_widget_get_window (widget), - -1, -1, /*x, y*/ - keyval, - 0 /*modifiers*/, - GDK_KEY_RELEASE); + + gtk_test_widget_send_key(widget, keyval, 0); + #endif /* ! GDK_WINDOWING_QUARTZ */ }