Skip to content

Commit cca095d

Browse files
committed
Ignore touch events if the backlight is off
1 parent 56fc4fb commit cca095d

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/backlight.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,7 @@ impl BacklightManager {
8686
set_backlight(&self.bl_file, self.current_bl);
8787
}
8888
}
89+
pub fn current_bl(&self) -> u32 {
90+
self.current_bl
91+
}
8992
}

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ fn main() {
313313
}
314314
},
315315
Event::Touch(te) => {
316-
if Some(te.device()) != digitizer {
316+
if Some(te.device()) != digitizer || backlight.current_bl() == 0 {
317317
continue
318318
}
319319
match te {

0 commit comments

Comments
 (0)