-
Hi all, I'm attempting to write a virtual keyboard for wayland using slint as my GUI library, however to do this I need access to the wl_surface object that slint (or one of its dependencies) is using, to bind zwp_input_panel_v1. Is there any way to do this using slint, or are there any workarounds? Thanks. Edit: I've managed to find the match ui
.window()
.window_handle()
.window_handle()
.unwrap()
.as_raw()
{
raw_window_handle::RawWindowHandle::Wayland(wayland_window) => {
let surface = wayland_window.surface;
appdata.clone().lock().unwrap().surface = Some(surface); // Err: expected `WlSurface`, found `NotNull<c_void>`
}
_ => {}
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Update: This works for accessing the match ui
.window()
.window_handle()
.window_handle()
.unwrap()
.as_raw()
{
raw_window_handle::RawWindowHandle::Wayland(wayland_window) => {
let nn_surface = wayland_window.surface;
let mut wl_surface_obj_id: wayland_client::backend::ObjectId;
unsafe {
wl_surface_obj_id = wayland_client::backend::ObjectId::from_ptr(
wl_surface::WlSurface::interface(),
nn_surface.as_ptr().cast(),
)
.unwrap();
}
let wl_surface: wl_surface::WlSurface =
wl_surface::WlSurface::from_id(&conn, wl_surface_obj_id).unwrap()
appdata.clone().lock().unwrap().surface = Some(wl_surface);
}
_ => {}
} Update: works fully now! |
Beta Was this translation helpful? Give feedback.
Update:
This works for accessing the
WlSurface
from slint's APIs(probably, still not quite complete yet, but a good start)