Function smithay_client_toolkit::output::add_output_listener
source · pub fn add_output_listener<F: Fn(WlOutput, &OutputInfo, DispatchData<'_>) + Send + Sync + 'static>(
output: &WlOutput,
f: F
) -> OutputListener
Expand description
Add a listener to this output
The provided closure will be called whenever a property of the output changes, including when it is removed by the compositor (in this case it’ll be marked as obsolete).
The returned OutputListener
keeps your callback alive,
dropping it will disable the callback and free the closure.