pub fn new<L>(
        display: &mut Display,
        name: String,
        physical: PhysicalProperties,
        logger: L,
    ) -> (Output, Global<WlOutput>)
    where
        L: Into<Option<::slog::Logger>>,
    {
        let log = crate::slog_or_fallback(logger).new(o!("smithay_module" => "output_handler"));

        info!(log, "Creating new wl_output"; "name" => &name);

        let inner = Arc::new(Mutex::new(Inner {
            name,
            log,
            instances: Vec::new(),
            physical,
            location: (0, 0).into(),
            transform: Transform::Normal,
            scale: 1,
            modes: Vec::new(),
            current_mode: None,
            preferred_mode: None,
            xdg_output: None,
        }));

        let output = Output { inner: inner.clone() };

        let global = display.create_global(
            3,
            Filter::new(move |(output, _version): (Main<WlOutput>, _), _, _| {
                output.assign_destructor(Filter::new(|output: WlOutput, _, _| {
                    let inner = output.as_ref().user_data().get::<Arc<Mutex<Inner>>>().unwrap();
                    inner
                        .lock()
                        .unwrap()
                        .instances
                        .retain(|o| !o.as_ref().equals(output.as_ref()));
                }));
                output.as_ref().user_data().set_threadsafe({
                    let inner = inner.clone();
                    move || inner
                });
                inner.lock().unwrap().new_global(output.deref().clone());
            }),
        );

        (output, global)
    }
/// Create a new output global with given name and physical properties
///
/// The global is directly registered into the event loop, and this function
/// returns the state token allowing you to access it, as well as the global handle,
/// in case you wish to remove this global in the future.
Create a new output global with given name and physical properties
The global is directly registered into the event loop, and this function
returns the state token allowing you to access it, as well as the global handle,
in case you wish to remove this global in the future.
Create a new output global with given name and physical properties The global is directly registered into the event loop and this function returns the state token allowing you to access it as well as the global handle in case you wish to remove this global in the future .
pub fn new<L>(
        display: &mut Display,
        name: String,
        physical: PhysicalProperties,
        logger: L,
    ) -> (Output, Global<WlOutput>)
    where
        L: Into<Option<::slog::Logger>>,
    {
        let log = crate::slog_or_fallback(logger).new(o!("smithay_module" => "output_handler"));
        info!(log, "Creating new wl_output"; "name" => &name);
        let inner = Arc::new(Mutex::new(Inner {
            name,
            log,
            instances: Vec::new(),
            physical,
            location: (0, 0).into(),
            transform: Transform::Normal,
            scale: 1,
            modes: Vec::new(),
            current_mode: None,
            preferred_mode: None,
            xdg_output: None,
        }));
        let output = Output { inner: inner.clone() };
        let global = display.create_global(
            3,
            Filter::new(move |(output, _version): (Main<WlOutput>, _), _, _| {
                output.assign_destructor(Filter::new(|output: WlOutput, _, _| {
                    let inner = output.as_ref().user_data().get::<Arc<Mutex<Inner>>>().unwrap();
                    inner
                        .lock()
                        .unwrap()
                        .instances
                        .retain(|o| !o.as_ref().equals(output.as_ref()));
                }));
                output.as_ref().user_data().set_threadsafe({
                    let inner = inner.clone();
                    move || inner
                });
                inner.lock().unwrap().new_global(output.deref().clone());
            }),
        );
        (output, global)
    }
pub fn new < L > ( display : & mut Display , name : String , physical : PhysicalProperties , logger : L , ) -> ( Output , Global < WlOutput > ) where L : Into < Option < :: slog :: Logger > > , { let log = crate :: slog_or_fallback ( logger ) . new ( o ! ( " " " " ) ) ; info ! ( log " " " " name ) ; let inner = Arc :: new ( Mutex :: new ( Inner { name , log , instances : Vec :: new ( ) , physical , location : ( 0 , 0 ) . into ( ) , transform : Transform :: Normal , scale : 1 , modes : Vec :: new ( ) , current_mode : None , preferred_mode : None , xdg_output : None , } ) ) ; let output = Output { inner : inner . clone ( ) } ; let global = display . create_global ( 3 , Filter :: new ( move | ( output , _version ) : ( Main < WlOutput > , _ ) , _ , _ | { output . assign_destructor ( Filter :: new ( | output : WlOutput , _ , _ | { let inner = output . as_ref ( ) . user_data ( ) . get :: < Arc < Mutex < Inner > > > ( ) . unwrap ( ) ; inner . lock ( ) . unwrap ( ) . instances . retain ( | o | ! o . as_ref ( ) . equals ( output . as_ref ( ) ) ) ; } ) ) ; output . as_ref ( ) . user_data ( ) . set_threadsafe ( { let inner = inner . clone ( ) ; move | | inner } ) ; inner . lock ( ) . unwrap ( ) . new_global ( output . deref ( ) . clone ( ) ) ; } ) , ) ; ( output , global ) }
Create a new output global with given name and physical properties
The global is directly registered into the event loop, and this function
returns the state token allowing you to access it, as well as the global handle,
in case you wish to remove this global in the future.
Create a new output global with given name and physical properties The global is directly registered into the event loop and this function returns the state token allowing you to access it as well as the global handle in case you wish to remove this global in the future .
display
&mut Display
name
String
physical
PhysicalProperties
logger
L
display
&mut Display
name
String
physical
PhysicalProperties
logger
L