mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
37 lines
1.1 KiB
Rust
37 lines
1.1 KiB
Rust
struct SuilX11Wrapper {
|
|
socket: GtkSocket,
|
|
plug: GtkPlug,
|
|
wrapper: SuilWrapper,
|
|
instance: SuilInstance,
|
|
idle_iface: LV2UI_Idle_Interface,
|
|
idle_id: usize,
|
|
idle_ms: usize,
|
|
idle_size_req_id: usize,
|
|
initial_width: usize,
|
|
initial_height: usize,
|
|
req_width: usize,
|
|
req_height: usize,
|
|
}
|
|
|
|
struct SuilX11WrapperClass {
|
|
parent_class: GtkSocketClass,
|
|
}
|
|
|
|
impl SuilX11Wrapper {
|
|
fn x_window_is_valid (&self) {
|
|
let window: GdkWindow = gtk_widget_get_window(self.plug);
|
|
let root: X11Window = Some(0);
|
|
let parent: X11Window = Some(0);
|
|
let children: [X11Window] = None;
|
|
let child_count: usize = 0;
|
|
x_query_tree(window.xdisplay, window.xid, root, parent, children, &mut childcount);
|
|
for i in 0..child_count {
|
|
if children[i] == self.instance.ui_widget {
|
|
x_free(children);
|
|
return true;
|
|
}
|
|
}
|
|
x_free(children);
|
|
return false;
|
|
}
|
|
}
|