diff --git a/src/backend/drm/backend.rs b/src/backend/drm/backend.rs index 1d275f8..76bfbac 100644 --- a/src/backend/drm/backend.rs +++ b/src/backend/drm/backend.rs @@ -203,6 +203,11 @@ impl DrmBackend { self.connectors.retain(|x| *x != connector); } + /// Gets the currently used mode + pub fn current_mode(&self) -> Mode { + self.mode + } + /// Changes the currently set mode /// /// # Errors diff --git a/src/backend/graphics/glium.rs b/src/backend/graphics/glium.rs index 9f5099a..5df7f14 100644 --- a/src/backend/graphics/glium.rs +++ b/src/backend/graphics/glium.rs @@ -77,7 +77,8 @@ impl From for GliumGraphicsBackend { } impl EGLWaylandExtensions - for GliumGraphicsBackend { + for GliumGraphicsBackend +{ fn bind_wl_display(&self, display: &Display) -> EGLResult { (*self.backend).0.bind_wl_display(display) } diff --git a/src/backend/udev.rs b/src/backend/udev.rs index a429085..b85b4b2 100644 --- a/src/backend/udev.rs +++ b/src/backend/udev.rs @@ -60,7 +60,8 @@ pub struct UdevBackend< } impl + 'static, S: Session + 'static, T: UdevHandler + 'static> - UdevBackend { + UdevBackend +{ /// Creates a new `UdevBackend` and adds it to the given `EventLoop`'s state. /// /// ## Arguments @@ -177,7 +178,8 @@ impl< H: DrmHandler + 'static, S: Session + 'static, T: UdevHandler + 'static, -> SessionObserver for StateToken> { +> SessionObserver for StateToken> +{ fn pause<'a>(&mut self, state: &mut StateProxy<'a>) { state.with_value(self, |state, udev| { for &mut (ref mut device, _) in udev.devices.values_mut() { diff --git a/src/wayland/compositor/region.rs b/src/wayland/compositor/region.rs index b4f0b48..437477b 100644 --- a/src/wayland/compositor/region.rs +++ b/src/wayland/compositor/region.rs @@ -11,8 +11,7 @@ pub struct RegionData { impl RegionData { /// Initialize the user_data of a region, must be called right when the surface is created pub unsafe fn init(region: &wl_region::WlRegion) { - region.set_user_data(Box::into_raw(Box::new(Mutex::new(RegionData::default()))) - as *mut _) + region.set_user_data(Box::into_raw(Box::new(Mutex::new(RegionData::default()))) as *mut _) } /// Cleans the user_data of that surface, must be called when it is destroyed diff --git a/src/wayland/shell/wl_handlers.rs b/src/wayland/shell/wl_handlers.rs index e4dd036..28307d4 100644 --- a/src/wayland/shell/wl_handlers.rs +++ b/src/wayland/shell/wl_handlers.rs @@ -83,8 +83,9 @@ where ); return; } - shell_surface - .set_user_data(Box::into_raw(Box::new(unsafe { (surface.clone_unchecked(), shell.clone_unchecked()) })) as *mut _); + shell_surface.set_user_data(Box::into_raw(Box::new(unsafe { + (surface.clone_unchecked(), shell.clone_unchecked()) + })) as *mut _); evlh.register( &shell_surface, shell_surface_implementation(),