From 62a89c4bf63357fb95c34898a37ff663293a8dea Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 16 Nov 2021 12:17:08 +0100 Subject: Ensure window gets clipboard owner before setting clipboard string --- tests/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/main.c b/tests/main.c index a9aebec..cee3ec7 100644 --- a/tests/main.c +++ b/tests/main.c @@ -256,8 +256,9 @@ int main(int argc, char **argv) { } case MGL_EVENT_KEY_PRESSED: { if(event.key.code == MGL_KEY_C) { - mgl_window_set_clipboard(&window, "hello", 5); - fprintf(stderr, "Copied 'hello' to the clipboard\n"); + const char *str = "東京都, Tōkyō-to"; + mgl_window_set_clipboard(&window, str, strlen(str)); + fprintf(stderr, "Copied '%s' to the clipboard\n", str); } else if(event.key.code == MGL_KEY_V) { char *str; size_t size; -- cgit v1.2.3