mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
refact, win, clipboard, notify callback, tmp commit
Signed-off-by: dignow <linlong1265@gmail.com>
This commit is contained in:
@@ -1089,6 +1089,39 @@ pub fn stop_global_event_stream(app_type: String) {
|
||||
let _ = GLOBAL_EVENT_STREAM.write().unwrap().remove(&app_type);
|
||||
}
|
||||
|
||||
fn msgbox_clipboard_(channel: &str, r#type: u32, msg: &str, details: &str) {
|
||||
let msgtype = format!(
|
||||
"{}-nocancel-nook-hasclose",
|
||||
if r#type == 0 {
|
||||
"info"
|
||||
} else if r#type == 1 {
|
||||
"warn"
|
||||
} else {
|
||||
"error"
|
||||
}
|
||||
);
|
||||
let text = format!("{} {}", msg, details);
|
||||
if let Ok(event) = serde_json::ser::to_string(&HashMap::from([
|
||||
("type", &msgtype as &str),
|
||||
("title", "clipboard"),
|
||||
("text", &text),
|
||||
("link", ""),
|
||||
("hasRetry", ""),
|
||||
])) {
|
||||
push_global_event(channel, event);
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn msgbox_clipboard_remote(r#type: u32, msg: &str, details: &str) {
|
||||
msgbox_clipboard_(APP_TYPE_DESKTOP_REMOTE, r#type, msg, details);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn msgbox_clipboard_cm(r#type: u32, msg: &str, details: &str) {
|
||||
msgbox_clipboard_(APP_TYPE_CM, r#type, msg, details);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
unsafe extern "C" fn get_rgba() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user