I coded the following simple GTK application. The target board that I use is TurboX-C610, that is manufactured by Thundercomm, and the firmware version is 200007.1.
#include <gtk/gtk.h>
int main(int argc, char *argv[]) {
GtkWidget *window;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show(window);
g_signal_connect(window, "destroy",
G_CALLBACK(gtk_main_quit), NULL);
gtk_main();
return 0;
}
I compiled the code by using cross compiler of Turbo-C610 that is provided by manufacturer. After doing that, I executed the program on target board by using ADB. But the following error is occurred. Because window system is Wayland, I do export GDK_DEGUG=wayland.
(mytest:5695): Gdk-WARNING **: 07:52:13.039: Error 22 (Invalid argument) dispatching to Wayland display.
When I did export WAYLAND_DEBUG=1, the logs are following,
[ 89809.336] -> wl_display@1.get_registry(new id wl_registry@2)
[ 89809.495] -> wl_display@1.sync(new id wl_callback@3)
[ 89809.832] wl_display@1.delete_id(3)
[ 89809.904] wl_registry@2.global(1, "wl_compositor", 3)
[ 89810.066] -> wl_registry@2.bind(1, "wl_compositor", 3, new id [unknown]@4)
[ 89810.190] wl_registry@2.global(2, "wl_subcompositor", 1)
[ 89810.278] -> wl_registry@2.bind(2, "wl_subcompositor", 1, new id [unknown]@5)
[ 89810.400] wl_registry@2.global(3, "wl_scaler", 2)
[ 89810.477] wl_registry@2.global(4, "presentation", 1)
[ 89810.560] wl_registry@2.global(5, "wl_pll", 1)
[ 89810.628] wl_registry@2.global(6, "wl_data_device_manager", 2)
[ 89810.713] -> wl_registry@2.bind(6, "wl_data_device_manager", 1, new id [unknown]@6)
[ 89810.827] wl_registry@2.global(7, "wl_shm", 1)
[ 89810.907] -> wl_registry@2.bind(7, "wl_shm", 1, new id [unknown]@7)
[ 89811.022] wl_registry@2.global(8, "wayland_buffer_backend", 4)
[ 89811.101] wl_registry@2.global(9, "wl_output", 3)
[ 89811.178] -> wl_registry@2.bind(9, "wl_output", 2, new id [unknown]@8)
[ 89811.303] -> wl_display@1.sync(new id wl_callback@9)
[ 89811.353] wl_registry@2.global(10, "zlinux_dmabuf", 1)
[ 89811.437] wl_registry@2.global(11, "gbm_buffer_backend", 1)
[ 89811.521] wl_registry@2.global(12, "wl_input_panel", 1)
[ 89811.605] wl_registry@2.global(13, "wl_text_input_manager", 1)
[ 89811.684] wl_registry@2.global(14, "wl_shell", 1)
[ 89811.768] wl_registry@2.global(15, "xdg_shell", 1)
[ 89811.843] -> wl_registry@2.bind(15, "xdg_shell", 1, new id [unknown]@10)
[ 89811.927] -> xdg_shell@10.use_unstable_version(5)
[ 89811.965] wl_registry@2.global(16, "desktop_shell", 3)
[ 89812.003] wl_registry@2.global(17, "workspace_manager", 1)
[ 89812.062] wl_registry@2.global(18, "screenshooter", 1)
[ 89812.147] wl_callback@3.done(0)
[ 89812.337] wl_display@1.delete_id(9)
[ 89812.362] wl_output@8.geometry(0, 0, 62, 110, 1, "unknown", "unknown", 0)
[ 89812.413] wl_output@8.scale(1)
[ 89812.422] wl_output@8.done()
[ 89812.432] wl_callback@9.done(0)
[ 89849.534] -> wl_shm@7.create_pool(new id wl_shm_pool@9, fd 6, 4096)
[ 89849.627] -> wl_shm_pool@9.resize(8832)
[ 89849.679] -> wl_shm_pool@9.resize(18624)
[ 89851.662] -> wl_compositor@4.create_surface(new id wl_surface@3)
[ 89851.704] -> wl_surface@3.set_opaque_region(nil)
[ 89851.720] -> wl_surface@3.set_input_region(nil)
[ 89852.011] -> wl_compositor@4.create_region(new id wl_region@11)
[ 89852.033] -> wl_surface@3.set_opaque_region(wl_region@11)
[ 89852.045] -> wl_region@11.destroy()
[ 89852.107] -> wl_compositor@4.create_region(new id wl_region@12)
[ 89852.120] -> wl_region@12.add(16, 13, 20, 20)
[ 89852.151] -> wl_surface@3.set_input_region(wl_region@12)
[ 89852.161] -> wl_region@12.destroy()
[ 89852.176] -> wl_compositor@4.create_region(new id wl_region@13)
[ 89852.185] -> wl_region@13.add(16, 13, 20, 20)
[ 89852.204] -> wl_surface@3.set_input_region(wl_region@13)
[ 89852.215] -> wl_region@13.destroy()
[ 89856.835] -> wl_surface@3.set_input_region(nil)
[ 89856.993] -> wl_surface@3.set_input_region(nil)
[ 89857.016] -> wl_surface@3.set_input_region(nil)
[ 89857.055] -> wl_surface@3.set_input_region(nil)
[ 89857.142] -> wl_surface@3.set_input_region(nil)
[ 89857.238] -> wl_surface@3.set_input_region(nil)
[ 89857.322] -> xdg_shell@10.get_xdg_surface(new id xdg_surface@14, wl_surface@3)
[ 89857.338] -> xdg_surface@14.set_parent(nil)
[ 89857.349] -> xdg_surface@14.set_title("mytest")
[ 89857.357] -> xdg_surface@14.set_window_geometry(26, 23, 59, 52)
[ 89857.380] -> xdg_surface@14.set_app_id("mytest")
[ 89868.738] -> wl_compositor@4.create_region(new id wl_region@15)
[ 89868.781] -> wl_region@15.add(33, 23, 45, 7)
[ 89868.795] -> wl_region@15.add(26, 30, 59, 45)
[ 89868.803] -> wl_surface@3.set_opaque_region(wl_region@15)
[ 89868.807] -> wl_region@15.destroy()
[ 89868.904] -> wl_compositor@4.create_region(new id wl_region@16)
[ 89868.920] -> wl_region@16.add(16, 13, 79, 72)
[ 89868.970] -> wl_surface@3.set_input_region(wl_region@16)
[ 89868.980] -> wl_region@16.destroy()
[ 89870.653] -> wl_compositor@4.create_region(new id wl_region@17)
[ 89870.684] -> wl_region@17.add(33, 23, 79, 7)
[ 89870.701] -> wl_region@17.add(26, 30, 93, 45)
[ 89870.719] -> wl_surface@3.set_opaque_region(wl_region@17)
[ 89870.728] -> wl_region@17.destroy()
[ 89870.777] -> wl_compositor@4.create_region(new id wl_region@18)
[ 89870.788] -> wl_region@18.add(16, 13, 113, 72)
[ 89870.808] -> wl_surface@3.set_input_region(wl_region@18)
[ 89870.818] -> wl_region@18.destroy()
[ 89870.951] -> wl_shm@7.create_pool(new id wl_shm_pool@19, fd 7, 60320)
[ 89870.980] -> wl_shm_pool@19.create_buffer(new id wl_buffer@20, 0, 145, 104, 580, 0)
[ 89872.995] -> wl_surface@3.attach(wl_buffer@20, 0, 0)
[ 89873.037] -> wl_surface@3.set_buffer_scale(1)
[ 89873.048] -> wl_surface@3.damage(0, 0, 145, 104)
[ 89873.083] -> wl_surface@3.frame(new id wl_callback@21)
[ 89873.095] -> wl_surface@3.commit()
[08:49:23.495] libwayland: file descriptor expected, object (7), message create_pool(nhi)
[ 89873.497] wl_display@1.delete_id(11)
[ 89873.524] wl_display@1.delete_id(12)
[ 89873.527] wl_display@1.delete_id(13)
[ 89873.543] wl_display@1.delete_id(15)
[ 89873.553] wl_display@1.delete_id(16)
[ 89873.563] wl_display@1.delete_id(17)
[ 89873.573] wl_display@1.delete_id(18)
[ 89873.583] wl_display@1.error(wl_display@1, 1, "invalid arguments for wl_shm@7.create_pool")
The error is related to wl_display_create_pool. So I researched on wl_shm and pool and relation of Wayland and GTK, but I can't get any solutions.
To solve this problem, I wonder what I should do.