Hi, how to get the id of the window obtained from call to g_io_channel_read_line, as shown below?
let mut raw: *mut std::os::raw::c_char = std::ptr::null_mut();
let size: *mut GType = std::ptr::null_mut();
let terminator_pos: *mut GType = std::ptr::null_mut();
let ptr_error = std::ptr::null_mut();
&mut raw,//HERE IS A WINDOW ID WRITTEN
Why are you doing …any of this?
@zbrown I’m porting this:
It seems that Onboard is already available on Ubuntu18.04. If you use GIO you can get your window id and not need to start Onboard before your app. Looked interesting so I gave it a try. A lot that can be improved here also.
Test getting an onboard keyboard as a plug in a socket.
gcc -Wall onboard_socket1.c -o onboard_socket1 `pkg-config --cflags --libs gtk+-3.0`
Tested on Ubuntu18.04 and GTK3.22
That doesn’t really explain why your doing all this unsafe code?
There are far better ways to read …whatever your reading
Rust aside, writing an X11-only application in 2022 doesn’t sound like the best idea.
I’m pretty certain that you are correct, I simply am not aware of those.
Could you please give examples how to port this to rust so there is no unsafe code?
retval=g_spawn_async_with_pipes(NULL, arg_v, NULL, G_SPAWN_DO_NOT_REAP_CHILD|G_SPAWN_SEARCH_PATH, NULL, NULL, &child_pid, NULL, &std_out, NULL, &error);
g_io_add_watch(std_out_ch, G_IO_IN | G_IO_HUP, (GIOFunc)watch_out_channel, data);
g_io_channel_read_line(channel, &string1, &size, NULL, NULL);
That wasn’t my idea. Guys who started that app over a decade ago made that decision. Now X11 is a target and there is simply no chance of changing it in any near future.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.