diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2023-09-26 10:42:56 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2023-09-26 13:45:03 +0400 |
| commit | 906ee36a934154221f1b8ef6d919f80e9ac950fb (patch) | |
| tree | 84e4355d06e86784633d3969315e77b75a479092 /src/backend/tty.rs | |
| parent | ac16717f4eb6d339ae0a544ac35b8305ffc8802e (diff) | |
| download | niri-906ee36a934154221f1b8ef6d919f80e9ac950fb.tar.gz niri-906ee36a934154221f1b8ef6d919f80e9ac950fb.tar.bz2 niri-906ee36a934154221f1b8ef6d919f80e9ac950fb.zip | |
Skip rendering when backend is inactive
Diffstat (limited to 'src/backend/tty.rs')
| -rw-r--r-- | src/backend/tty.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/tty.rs b/src/backend/tty.rs index 5204c44a..9cfd46ee 100644 --- a/src/backend/tty.rs +++ b/src/backend/tty.rs @@ -813,6 +813,14 @@ impl Tty { pub fn gbm_device(&self) -> Option<GbmDevice<DrmDeviceFd>> { self.output_device.as_ref().map(|d| d.gbm.clone()) } + + pub fn is_active(&self) -> bool { + let Some(device) = &self.output_device else { + return false; + }; + + device.drm.is_active() + } } fn refresh_interval(mode: DrmMode) -> Duration { |
