pub fn change_current_state(
        &self,
        new_mode: Option<Mode>,
        new_transform: Option<Transform>,
        new_scale: Option<i32>,
        new_location: Option<Point<i32, Logical>>,
    ) {
        let mut inner = self.inner.lock().unwrap();
        if let Some(mode) = new_mode {
            if inner.modes.iter().all(|&m| m != mode) {
                inner.modes.push(mode);
            }
            inner.current_mode = new_mode;
        }
        if let Some(transform) = new_transform {
            inner.transform = transform;
        }
        if let Some(scale) = new_scale {
            inner.scale = scale;
        }
        let mut flags = WMode::Current;
        if inner.preferred_mode == new_mode {
            flags |= WMode::Preferred;
        }
        if let Some(new_location) = new_location {
            inner.location = new_location;
        }

        // XdgOutput has to be updated before WlOutput
        // Because WlOutput::done() has to allways be called last
        if let Some(xdg_output) = inner.xdg_output.as_ref() {
            xdg_output.change_current_state(new_mode, new_scale, new_location);
        }

        for output in &inner.instances {
            if let Some(mode) = new_mode {
                output.mode(flags, mode.size.w, mode.size.h, mode.refresh);
            }
            if new_transform.is_some() || new_location.is_some() {
                inner.send_geometry(output);
            }
            if let Some(scale) = new_scale {
                if output.as_ref().version() >= 2 {
                    output.scale(scale);
                }
            }
            if output.as_ref().version() >= 2 {
                output.done();
            }
        }
    }
/// Change the current state of this output
///
/// You can changed the current mode, transform status, location or scale of this output. Providing
/// `None` to any of these field means that the value does not change.
///
/// If the provided mode was not previously known to this output, it is added to its
/// internal list.
///
/// By default, transform status is `Normal`, and scale is `1`.
Change the current state of this output
You can changed the current mode, transform status, location or scale of this output. Providing
`None` to any of these field means that the value does not change.

If the provided mode was not previously known to this output, it is added to its
internal list.

By default, transform status is `Normal`, and scale is `1`.
Change the current state of this output You can changed the current mode transform status location or scale of this output . Providing ` None ` to any of these field means that the value does not change . If the provided mode was not previously known to this output it is added to its internal list . By default transform status is ` Normal ` and scale is ` 1 ` .
pub fn change_current_state(
        &self,
        new_mode: Option<Mode>,
        new_transform: Option<Transform>,
        new_scale: Option<i32>,
        new_location: Option<Point<i32, Logical>>,
    ) {
        let mut inner = self.inner.lock().unwrap();
        if let Some(mode) = new_mode {
            if inner.modes.iter().all(|&m| m != mode) {
                inner.modes.push(mode);
            }
            inner.current_mode = new_mode;
        }
        if let Some(transform) = new_transform {
            inner.transform = transform;
        }
        if let Some(scale) = new_scale {
            inner.scale = scale;
        }
        let mut flags = WMode::Current;
        if inner.preferred_mode == new_mode {
            flags |= WMode::Preferred;
        }
        if let Some(new_location) = new_location {
            inner.location = new_location;
        }
        // XdgOutput has to be updated before WlOutput
        // Because WlOutput::done() has to allways be called last
        if let Some(xdg_output) = inner.xdg_output.as_ref() {
            xdg_output.change_current_state(new_mode, new_scale, new_location);
        }
        for output in &inner.instances {
            if let Some(mode) = new_mode {
                output.mode(flags, mode.size.w, mode.size.h, mode.refresh);
            }
            if new_transform.is_some() || new_location.is_some() {
                inner.send_geometry(output);
            }
            if let Some(scale) = new_scale {
                if output.as_ref().version() >= 2 {
                    output.scale(scale);
                }
            }
            if output.as_ref().version() >= 2 {
                output.done();
            }
        }
    }
pub fn change_current_state ( & self , new_mode : Option < Mode > , new_transform : Option < Transform > , new_scale : Option < i32 > , new_location : Option < Point < i32 , Logical > > , ) { let mut inner = self . inner . lock ( ) . unwrap ( ) ; if let Some ( mode ) = new_mode { if inner . modes . iter ( ) . all ( | & m | m != mode ) { inner . modes . push ( mode ) ; } inner . current_mode = new_mode ; } if let Some ( transform ) = new_transform { inner . transform = transform ; } if let Some ( scale ) = new_scale { inner . scale = scale ; } let mut flags = WMode :: Current ; if inner . preferred_mode == new_mode { flags |= WMode :: Preferred ; } if let Some ( new_location ) = new_location { inner . location = new_location ; } // XdgOutput has to be updated before WlOutput // Because WlOutput::done() has to allways be called last if let Some ( xdg_output ) = inner . xdg_output . as_ref ( ) { xdg_output . change_current_state ( new_mode , new_scale , new_location ) ; } for output in & inner . instances { if let Some ( mode ) = new_mode { output . mode ( flags , mode . size . w , mode . size . h , mode . refresh ) ; } if new_transform . is_some ( ) || new_location . is_some ( ) { inner . send_geometry ( output ) ; } if let Some ( scale ) = new_scale { if output . as_ref ( ) . version ( ) >= 2 { output . scale ( scale ) ; } } if output . as_ref ( ) . version ( ) >= 2 { output . done ( ) ; } } }
Change the current state of this output
You can changed the current mode, transform status, location or scale of this output.
Change the current state of this output You can changed the current mode transform status location or scale of this output .
&self
new_mode
Option<Mode>
new_transform
Option<Transform>
new_scale
Option<i32>
new_location
Option<Point<i32, Logical>>
&self
new_mode
Option<Mode>
new_transform
Option<Transform>
new_scale
Option<i32>
new_location
Option<Point<i32, Logical>>