pub fn set_event_handler_no_op<P>(proxy: &P)where
P: OwnedProxy,Expand description
Sets the event handler of the proxy to ignore all events.
This can be used in the following situation:
- The application is not interested in events from this proxy.
- But the interface has events that contain file descriptors or create new proxies.
Not setting any event handler would cause the file descriptors and new proxies to be leaked. Using this function will ensure that all resources are released.
ยงExample
let lib = Libwayland::open().unwrap();
let con = lib.connect_to_default_display().unwrap();
let queue = con.create_queue(c"queue name");
let display: WlDisplay = queue.display();
let sync = display.sync();
proxy::set_event_handler_no_op(&sync);