Merge pull request #67 from Smithay/drm/get_current_mode
Add getter for current `DrmBackend` mode
This commit is contained in:
commit
63aa7f8474
|
@ -203,6 +203,11 @@ impl<A: Device + 'static> DrmBackend<A> {
|
|||
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
|
||||
|
|
|
@ -77,7 +77,8 @@ impl<T: EGLGraphicsBackend + 'static> From<T> for GliumGraphicsBackend<T> {
|
|||
}
|
||||
|
||||
impl<T: EGLGraphicsBackend + EGLWaylandExtensions + 'static> EGLWaylandExtensions
|
||||
for GliumGraphicsBackend<T> {
|
||||
for GliumGraphicsBackend<T>
|
||||
{
|
||||
fn bind_wl_display(&self, display: &Display) -> EGLResult<EGLDisplay> {
|
||||
(*self.backend).0.bind_wl_display(display)
|
||||
}
|
||||
|
|
|
@ -60,7 +60,8 @@ pub struct UdevBackend<
|
|||
}
|
||||
|
||||
impl<H: DrmHandler<SessionFdDrmDevice> + 'static, S: Session + 'static, T: UdevHandler<H> + 'static>
|
||||
UdevBackend<H, S, T> {
|
||||
UdevBackend<H, S, T>
|
||||
{
|
||||
/// Creates a new `UdevBackend` and adds it to the given `EventLoop`'s state.
|
||||
///
|
||||
/// ## Arguments
|
||||
|
@ -177,7 +178,8 @@ impl<
|
|||
H: DrmHandler<SessionFdDrmDevice> + 'static,
|
||||
S: Session + 'static,
|
||||
T: UdevHandler<H> + 'static,
|
||||
> SessionObserver for StateToken<UdevBackend<H, S, T>> {
|
||||
> SessionObserver for StateToken<UdevBackend<H, S, T>>
|
||||
{
|
||||
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() {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Reference in New Issue