view_created

Function view_created 

Source
pub fn view_created(callback: extern "C" fn(view: WlcView) -> bool)
Expand description

Callback invoked when a view is created. Return true to allow the view to be created.

When a new view is created, the following should probably be applied:

  • Set the view’s mask to the output’s mask
  • Focus the view
  • Bring the view to the front

§Example

use rustwlc::WlcView;

extern fn view_created(view: WlcView) -> bool {
    println!("View \"{}\" was created ({:?})", view.get_class(), view);
    view.set_mask(view.get_output().get_mask());
    view.bring_to_front();
    view.focus();
    return true;
}