Privacy mode, msgbox, add details

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-09-17 10:53:04 +08:00
parent eb5ea17610
commit db2e4f30a7
9 changed files with 112 additions and 41 deletions

View File

@@ -627,8 +627,8 @@ pub fn toggle_blank_screen(_v: bool) {
// https://unix.stackexchange.com/questions/17170/disable-keyboard-mouse-input-on-unix-under-x
}
pub fn block_input(_v: bool) -> bool {
true
pub fn block_input(_v: bool) -> (bool, String) {
(true, "".to_owned())
}
pub fn is_installed() -> bool {

View File

@@ -572,8 +572,8 @@ pub fn toggle_blank_screen(_v: bool) {
// https://unix.stackexchange.com/questions/17115/disable-keyboard-mouse-temporarily
}
pub fn block_input(_v: bool) -> bool {
true
pub fn block_input(_v: bool) -> (bool, String) {
(true, "".to_owned())
}
pub fn is_installed() -> bool {

View File

@@ -1269,9 +1269,15 @@ pub fn toggle_blank_screen(v: bool) {
}
}
pub fn block_input(v: bool) -> bool {
pub fn block_input(v: bool) -> (bool, String) {
let v = if v { TRUE } else { FALSE };
unsafe { BlockInput(v) == TRUE }
unsafe {
if BlockInput(v) == TRUE {
(true, "".to_owned())
} else {
(false, format!("Error code: {}", GetLastError()))
}
}
}
pub fn add_recent_document(path: &str) {