Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
372c255293 | ||
|
|
353045e786 | ||
|
|
2461514476 | ||
|
|
a3c513056a | ||
|
|
47544054a2 | ||
|
|
7cd70b3d18 | ||
|
|
67090d3aa1 | ||
|
|
001b0e9617 | ||
|
|
0bc2473ffe | ||
|
|
3f4bfe535e | ||
|
|
9b9e5f113a | ||
|
|
1d4abd0258 | ||
|
|
6da7977a94 | ||
|
|
25d2c6db55 | ||
|
|
f0bd880fe7 | ||
|
|
a916af8f00 | ||
|
|
9f9585ce15 | ||
|
|
e8a865924b | ||
|
|
c9c0b5d0ef | ||
|
|
5406950b02 | ||
|
|
685fa2e4a1 | ||
|
|
e5bc204fe4 |
Generated
+13
-18
@@ -4163,16 +4163,6 @@ version = "2.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
|
||||
|
||||
[[package]]
|
||||
name = "iri-string"
|
||||
version = "0.7.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"serde 1.0.228",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "is-terminal"
|
||||
version = "0.4.16"
|
||||
@@ -6772,7 +6762,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "rdev"
|
||||
version = "0.5.0-2"
|
||||
source = "git+https://github.com/rustdesk-org/rdev#a361d86a8b0245f3618a9efb375c149530a6b599"
|
||||
source = "git+https://github.com/rustdesk-org/rdev#0904f23ce496e255461a98848b85c11fa5a62eab"
|
||||
dependencies = [
|
||||
"cocoa 0.24.1",
|
||||
"core-foundation 0.9.4",
|
||||
@@ -6901,11 +6891,10 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "reqwest"
|
||||
version = "0.12.24"
|
||||
version = "0.12.28"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f"
|
||||
checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147"
|
||||
dependencies = [
|
||||
"async-compression",
|
||||
"base64 0.22.1",
|
||||
"bytes",
|
||||
"futures-channel",
|
||||
@@ -6934,7 +6923,6 @@ dependencies = [
|
||||
"tokio",
|
||||
"tokio-native-tls",
|
||||
"tokio-rustls",
|
||||
"tokio-util",
|
||||
"tower",
|
||||
"tower-http",
|
||||
"tower-service",
|
||||
@@ -7187,6 +7175,7 @@ dependencies = [
|
||||
"uuid",
|
||||
"virtual_display",
|
||||
"wallpaper",
|
||||
"wayland-client",
|
||||
"winapi 0.3.9",
|
||||
"windows 0.61.1",
|
||||
"windows-service",
|
||||
@@ -7196,6 +7185,7 @@ dependencies = [
|
||||
"wol-rs",
|
||||
"x11-clipboard 0.8.1",
|
||||
"x11rb 0.12.0",
|
||||
"xkbcommon-dl",
|
||||
"xxhash-rust",
|
||||
"zstd",
|
||||
]
|
||||
@@ -8744,20 +8734,25 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tower-http"
|
||||
version = "0.6.6"
|
||||
version = "0.6.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2"
|
||||
checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840"
|
||||
dependencies = [
|
||||
"async-compression",
|
||||
"bitflags 2.9.1",
|
||||
"bytes",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"http",
|
||||
"http-body",
|
||||
"iri-string",
|
||||
"http-body-util",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tower",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -202,6 +202,8 @@ gtk = "0.18"
|
||||
termios = "0.3"
|
||||
terminfo = "0.8"
|
||||
winit = "0.30"
|
||||
wayland-client = "0.31"
|
||||
xkbcommon-dl = { version = "0.4", features = ["x11"] }
|
||||
|
||||
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
|
||||
openssl = { version = "0.10", features = ["vendored"] }
|
||||
|
||||
@@ -199,7 +199,7 @@ class AudioRecordHandle(private var context: Context, private var isVideoStart:
|
||||
context,
|
||||
Manifest.permission.RECORD_AUDIO
|
||||
) != PackageManager.PERMISSION_GRANTED) {
|
||||
"To start a voice call, enable \"Audio capture\" on the \"Screen share\" page."
|
||||
"To start a voice call, enable \"Audio capture\" on the \"Share screen\" page."
|
||||
} else {
|
||||
"Failed to start voice call."
|
||||
}
|
||||
|
||||
@@ -480,6 +480,10 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
||||
return buildInstallCard("Permissions", "config_screen", "Configure",
|
||||
() async {
|
||||
bind.mainIsCanScreenRecording(prompt: true);
|
||||
// macOS shows the request prompt only once per app, so later
|
||||
// presses would do nothing without opening the settings pane.
|
||||
launchUrl(Uri.parse(
|
||||
'x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture'));
|
||||
watchIsCanScreenRecording = true;
|
||||
}, help: 'Help', link: translate("doc_mac_permission"));
|
||||
} else if (!isOutgoingOnly && !bind.mainIsProcessTrusted(prompt: false)) {
|
||||
|
||||
@@ -62,12 +62,15 @@ class _InstallPageBody extends StatefulWidget {
|
||||
|
||||
class _InstallPageBodyState extends State<_InstallPageBody>
|
||||
with WindowListener {
|
||||
static const _printerStatusTimeout = Duration(seconds: 5);
|
||||
|
||||
late final TextEditingController controller;
|
||||
final RxBool startmenu = true.obs;
|
||||
final RxBool desktopicon = true.obs;
|
||||
final RxBool printer = false.obs;
|
||||
final RxBool showProgress = false.obs;
|
||||
final RxBool btnEnabled = true.obs;
|
||||
final RxBool cancelEnabled = true.obs;
|
||||
|
||||
// todo move to theme.
|
||||
final buttonStyle = OutlinedButton.styleFrom(
|
||||
@@ -83,10 +86,33 @@ class _InstallPageBodyState extends State<_InstallPageBody>
|
||||
printer.value = installOptions['PRINTER'] == '1';
|
||||
}
|
||||
|
||||
Future<void> _loadPrinterStatus() async {
|
||||
btnEnabled.value = false;
|
||||
showProgress.value = true;
|
||||
try {
|
||||
final status = await bind
|
||||
.mainGetCommon(key: 'is-printer-installed')
|
||||
.timeout(_printerStatusTimeout);
|
||||
printer.value = status == 'true';
|
||||
if (status != 'true' && status != 'false') {
|
||||
debugPrint('Failed to check printer installation status: $status');
|
||||
}
|
||||
} catch (e) {
|
||||
printer.value = false;
|
||||
debugPrint('Failed to check printer installation status: $e');
|
||||
} finally {
|
||||
showProgress.value = false;
|
||||
btnEnabled.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
windowManager.addListener(this);
|
||||
super.initState();
|
||||
if (printer.value) {
|
||||
_loadPrinterStatus();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -217,8 +243,9 @@ class _InstallPageBodyState extends State<_InstallPageBody>
|
||||
() => OutlinedButton.icon(
|
||||
icon: Icon(Icons.close_rounded, size: 16),
|
||||
label: Text(translate('Cancel')),
|
||||
onPressed:
|
||||
btnEnabled.value ? () => windowManager.close() : null,
|
||||
onPressed: cancelEnabled.value
|
||||
? () => windowManager.close()
|
||||
: null,
|
||||
style: buttonStyle,
|
||||
).marginOnly(right: 10),
|
||||
),
|
||||
@@ -253,6 +280,7 @@ class _InstallPageBodyState extends State<_InstallPageBody>
|
||||
void install() {
|
||||
do_install() {
|
||||
btnEnabled.value = false;
|
||||
cancelEnabled.value = false;
|
||||
showProgress.value = true;
|
||||
String args = '';
|
||||
if (startmenu.value) args += ' startmenu';
|
||||
|
||||
@@ -335,6 +335,10 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
|
||||
// clipboard
|
||||
oldValue = '';
|
||||
}
|
||||
// This length-only diff assumes the IME appends at the end. If an IME
|
||||
// leaves the caret inside paired punctuation, later insertions can replay
|
||||
// the closing symbol: "()" -> "(a)" sends ")" instead of "a". This is a
|
||||
// client text-diff issue, independent of the host keyboard layout.
|
||||
if (newValue.length == oldValue.length) {
|
||||
// ?
|
||||
} else if (newValue.length < oldValue.length) {
|
||||
|
||||
@@ -1030,5 +1030,7 @@ message Message {
|
||||
TerminalAction terminal_action = 31;
|
||||
TerminalResponse terminal_response = 32;
|
||||
PortForwardChannel port_forward_channel = 33;
|
||||
// Auto Login: the peer types the password only if it is at its logon or lock screen.
|
||||
OSLogin os_login = 34;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ const kUCKeyActionDisplay: u16 = 3;
|
||||
#[allow(non_upper_case_globals)]
|
||||
const kUCKeyTranslateDeadKeysBit: OptionBits = 1 << 31;
|
||||
const BUF_LEN: usize = 4;
|
||||
const KEYBOARD_ERROR_LOG_INTERVAL: std::time::Duration = std::time::Duration::from_secs(5);
|
||||
|
||||
const MOUSE_EVENT_BUTTON_NUMBER_BACK: i64 = 3;
|
||||
const MOUSE_EVENT_BUTTON_NUMBER_FORWARD: i64 = 4;
|
||||
@@ -428,7 +429,19 @@ impl KeyboardControllable for Enigo {
|
||||
if let Ok(event) = CGEvent::new_keyboard_event(src.clone(), 0, true) {
|
||||
event.set_string(cluster);
|
||||
self.post(event, None);
|
||||
} else {
|
||||
hbb_common::throttled_log!(
|
||||
KEYBOARD_ERROR_LOG_INTERVAL,
|
||||
error,
|
||||
"Failed to inject macOS Enigo key-sequence: could not create keyboard event"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
hbb_common::throttled_log!(
|
||||
KEYBOARD_ERROR_LOG_INTERVAL,
|
||||
error,
|
||||
"Failed to inject macOS Enigo key-sequence: event source is not initialized"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -436,17 +449,40 @@ impl KeyboardControllable for Enigo {
|
||||
fn key_click(&mut self, key: Key) {
|
||||
let keycode = self.key_to_keycode(key);
|
||||
if keycode == u16::MAX {
|
||||
hbb_common::throttled_log!(
|
||||
KEYBOARD_ERROR_LOG_INTERVAL,
|
||||
error,
|
||||
"Failed to inject macOS Enigo key-click: keycode mapping is unavailable"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if let Some(src) = self.event_source.as_ref() {
|
||||
if let Ok(event) = CGEvent::new_keyboard_event(src.clone(), keycode, true) {
|
||||
self.post(event, Some(keycode));
|
||||
} else {
|
||||
hbb_common::throttled_log!(
|
||||
KEYBOARD_ERROR_LOG_INTERVAL,
|
||||
error,
|
||||
"Failed to inject macOS Enigo key-down in key-click: could not create keyboard event"
|
||||
);
|
||||
}
|
||||
|
||||
if let Ok(event) = CGEvent::new_keyboard_event(src.clone(), keycode, false) {
|
||||
self.post(event, Some(keycode));
|
||||
} else {
|
||||
hbb_common::throttled_log!(
|
||||
KEYBOARD_ERROR_LOG_INTERVAL,
|
||||
error,
|
||||
"Failed to inject macOS Enigo key-up in key-click: could not create keyboard event"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
hbb_common::throttled_log!(
|
||||
KEYBOARD_ERROR_LOG_INTERVAL,
|
||||
error,
|
||||
"Failed to inject macOS Enigo key-click: event source is not initialized"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -465,10 +501,29 @@ impl KeyboardControllable for Enigo {
|
||||
|
||||
fn key_up(&mut self, key: Key) {
|
||||
let code = self.key_to_keycode(key);
|
||||
if code == u16::MAX {
|
||||
hbb_common::throttled_log!(
|
||||
KEYBOARD_ERROR_LOG_INTERVAL,
|
||||
error,
|
||||
"Cannot map macOS Enigo key-up to a keycode"
|
||||
);
|
||||
}
|
||||
if let Some(src) = self.event_source.as_ref() {
|
||||
if let Ok(event) = CGEvent::new_keyboard_event(src.clone(), code, false) {
|
||||
self.post(event, Some(code));
|
||||
} else {
|
||||
hbb_common::throttled_log!(
|
||||
KEYBOARD_ERROR_LOG_INTERVAL,
|
||||
error,
|
||||
"Failed to inject macOS Enigo key-up: could not create keyboard event"
|
||||
);
|
||||
}
|
||||
} else {
|
||||
hbb_common::throttled_log!(
|
||||
KEYBOARD_ERROR_LOG_INTERVAL,
|
||||
error,
|
||||
"Failed to inject macOS Enigo key-up: event source is not initialized"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ use winapi::{
|
||||
shared::{
|
||||
minwindef::{BOOL, DWORD, FALSE, LPBYTE, LPDWORD},
|
||||
ntdef::HANDLE,
|
||||
winerror::ERROR_INVALID_PRINTER_NAME,
|
||||
winerror::{ERROR_INSUFFICIENT_BUFFER, ERROR_INVALID_PRINTER_NAME},
|
||||
},
|
||||
um::winspool::{
|
||||
AddPrinterW, ClosePrinter, DeletePrinter, EnumPrintersW, OpenPrinterW, SetPrinterW,
|
||||
@@ -42,20 +42,49 @@ fn enum_local_printer(
|
||||
|
||||
#[inline]
|
||||
pub fn is_printer_added(name: &PCWSTR) -> ResultType<bool> {
|
||||
let r = common_enum(
|
||||
"EnumPrintersW",
|
||||
enum_local_printer,
|
||||
1,
|
||||
|info: &PRINTER_INFO_1W| {
|
||||
if is_name_equal(name, info.pName) {
|
||||
Some(true)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
},
|
||||
|| None,
|
||||
)?;
|
||||
Ok(r.unwrap_or(false))
|
||||
const PRINTER_INFO_LEVEL: DWORD = 1;
|
||||
let mut needed = 0;
|
||||
let mut returned = 0;
|
||||
if enum_local_printer(
|
||||
PRINTER_INFO_LEVEL,
|
||||
null_mut(),
|
||||
0,
|
||||
&mut needed,
|
||||
&mut returned,
|
||||
) == FALSE
|
||||
{
|
||||
let error = io::Error::last_os_error();
|
||||
if error.raw_os_error() != Some(ERROR_INSUFFICIENT_BUFFER as i32) || needed == 0 {
|
||||
bail!("Failed to query EnumPrintersW buffer size: {error}");
|
||||
}
|
||||
}
|
||||
if needed == 0 {
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
let mut buffer = vec![0u8; needed as usize];
|
||||
if enum_local_printer(
|
||||
PRINTER_INFO_LEVEL,
|
||||
buffer.as_mut_ptr(),
|
||||
needed,
|
||||
&mut needed,
|
||||
&mut returned,
|
||||
) == FALSE
|
||||
{
|
||||
bail!(
|
||||
"Failed to call EnumPrintersW, error: {}",
|
||||
io::Error::last_os_error()
|
||||
);
|
||||
}
|
||||
|
||||
let printers = buffer.as_ptr() as *const PRINTER_INFO_1W;
|
||||
for index in 0..returned {
|
||||
let printer = unsafe { &*printers.add(index as usize) };
|
||||
if is_name_equal(name, printer.pName) {
|
||||
return Ok(true);
|
||||
}
|
||||
}
|
||||
Ok(false)
|
||||
}
|
||||
|
||||
// Only return the first matched printer
|
||||
|
||||
@@ -553,6 +553,12 @@ impl DrmReader {
|
||||
plane_rotation_answer(rc, rotation)
|
||||
}
|
||||
|
||||
/// The primary plane's rotation read NOW, for a caller that has not grabbed (enumeration):
|
||||
/// `plane_rotation()` only reflects the last grab.
|
||||
pub fn query_plane_rotation(&mut self) -> Option<u32> {
|
||||
self.read_plane_rotation()
|
||||
}
|
||||
|
||||
/// Zero-copy EXPORT grab: fills a `drmtap_dmabuf_desc` (dma-buf fd, plane layout, HDR metadata) WITHOUT mapping, detiling or copying pixels, so on this
|
||||
/// path the root process never loads libEGL/libGLESv2. The exported fd is READ-ONLY (libdrmtap drops `DRM_RDWR` and `dup` shares that open file
|
||||
/// description), so the `--server` that receives it can map the scanout but never write the live framebuffer. Validation here is METADATA ONLY.
|
||||
|
||||
@@ -23,7 +23,7 @@ use gstreamer_app::AppSink;
|
||||
use lazy_static::lazy_static;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use base::platform::linux::CMD_SH;
|
||||
use base::platform::linux::{WaylandDisplayInfo, CMD_SH};
|
||||
use hbb_common::{anyhow::anyhow, bail, config, serde_json, tokio, ResultType};
|
||||
|
||||
use super::capturable::PixelProvider;
|
||||
@@ -157,6 +157,9 @@ pub struct PipeWireCapturable {
|
||||
pub position: (i32, i32),
|
||||
pub logical_size: (usize, usize),
|
||||
pub physical_size: (usize, usize),
|
||||
// False when `physical_size` is the portal size standing in for a resolution get_res() could
|
||||
// not read.
|
||||
physical_size_measured: bool,
|
||||
}
|
||||
|
||||
impl PipeWireCapturable {
|
||||
@@ -168,7 +171,7 @@ impl PipeWireCapturable {
|
||||
) -> Self {
|
||||
// alternative to get screen resolution as stream.size is not always correct ex: on fractional scaling
|
||||
// https://github.com/rustdesk/rustdesk/issues/6116#issuecomment-1817724244
|
||||
let physical_size = get_res(Self {
|
||||
let measured = get_res(Self {
|
||||
dbus_conn: conn.clone(),
|
||||
fd: fd.clone(),
|
||||
path: stream.path,
|
||||
@@ -177,8 +180,10 @@ impl PipeWireCapturable {
|
||||
position: stream.position,
|
||||
logical_size: stream.size,
|
||||
physical_size: (0, 0),
|
||||
})
|
||||
.unwrap_or(stream.size);
|
||||
physical_size_measured: false,
|
||||
});
|
||||
let physical_size_measured = measured.is_ok();
|
||||
let physical_size = measured.unwrap_or(stream.size);
|
||||
*resolution.lock().unwrap() = Some(physical_size);
|
||||
Self {
|
||||
dbus_conn: conn,
|
||||
@@ -189,6 +194,7 @@ impl PipeWireCapturable {
|
||||
position: stream.position,
|
||||
logical_size: stream.size,
|
||||
physical_size,
|
||||
physical_size_measured,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -277,6 +283,8 @@ fn gst_element(name: &str) -> ResultType<gst::Element> {
|
||||
impl PipeWireRecorder {
|
||||
pub fn new(capturable: PipeWireCapturable) -> ResultType<Self> {
|
||||
let pipeline = gst::Pipeline::new(None);
|
||||
// Clock waits on stale capture timestamps can exhaust the compositor's buffers.
|
||||
pipeline.use_clock(None::<&gst::Clock>);
|
||||
|
||||
let src = gst_element("pipewiresrc")?;
|
||||
src.set_property("fd", &capturable.fd.as_raw_fd())?;
|
||||
@@ -1289,6 +1297,26 @@ pub fn fill_displays(
|
||||
}
|
||||
|
||||
if all_displays.displays.len() > 1 {
|
||||
for (i, sd) in shared_displays.iter_mut().enumerate() {
|
||||
if let crate::Display::WAYLAND(d) = sd {
|
||||
let capturable = &mut d.0;
|
||||
if let Some(origin) = reconciled_origin(
|
||||
capturable.position,
|
||||
capturable.physical_size,
|
||||
capturable.physical_size_measured,
|
||||
&all_displays.displays,
|
||||
) {
|
||||
warn!(
|
||||
"Position {:?} names no output of size {:?}, using {:?}.",
|
||||
capturable.position, capturable.physical_size, origin
|
||||
);
|
||||
capturable.position = origin;
|
||||
if let Some(pw_stream) = rdp_info.streams.get_mut(i) {
|
||||
pw_stream.position = origin;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sort_streams(&all_displays, shared_displays, &mut rdp_info.streams);
|
||||
}
|
||||
|
||||
@@ -1301,6 +1329,50 @@ pub fn fill_displays(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// The origin a stream takes when its position names no output of its size. Only a measured size
|
||||
// moves a position: when get_res() failed, the size is the portal size, which can be the mode of
|
||||
// another output and says less than the position does, whether the portal sent that position or
|
||||
// try_fill_positions restored it from its cache.
|
||||
fn reconciled_origin(
|
||||
position: (i32, i32),
|
||||
size: (usize, usize),
|
||||
size_measured: bool,
|
||||
outputs: &[WaylandDisplayInfo],
|
||||
) -> Option<(i32, i32)> {
|
||||
if !size_measured {
|
||||
return None;
|
||||
}
|
||||
corrected_origin(position, size, outputs)
|
||||
}
|
||||
|
||||
// The origin for a stream whose position names no output of the stream's size (a rotated output
|
||||
// counts in either orientation), when exactly one output has that size. xdg-desktop-portal-hyprland reports every stream at (0, 0):
|
||||
// with no output there `sort_streams` dropped the stream, and with another output there the
|
||||
// stream took its origin and missed `try_fix_logical_size`, so the pointer landed on the wrong
|
||||
// output (#15731). With several outputs of that size the position is kept.
|
||||
fn corrected_origin(
|
||||
position: (i32, i32),
|
||||
size: (usize, usize),
|
||||
outputs: &[WaylandDisplayInfo],
|
||||
) -> Option<(i32, i32)> {
|
||||
let has_size = |o: &&WaylandDisplayInfo| {
|
||||
let mode = (o.width as usize, o.height as usize);
|
||||
mode == size || (o.transform % 180 != 0 && (mode.1, mode.0) == size)
|
||||
};
|
||||
if outputs
|
||||
.iter()
|
||||
.filter(has_size)
|
||||
.any(|o| (o.x, o.y) == position)
|
||||
{
|
||||
return None;
|
||||
}
|
||||
let mut same_size = outputs.iter().filter(has_size);
|
||||
match (same_size.next(), same_size.next()) {
|
||||
(Some(o), None) => Some((o.x, o.y)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
fn try_fill_positions(
|
||||
mouse_move_to: impl Fn(i32, i32),
|
||||
get_cursor_pos: fn() -> Option<(i32, i32)>,
|
||||
@@ -1603,6 +1675,7 @@ fn fill_multi_matched_positions_cursor(
|
||||
position: pw_stream_with_cursor.position,
|
||||
logical_size: pw_stream_with_cursor.size,
|
||||
physical_size: (0, 0),
|
||||
physical_size_measured: false,
|
||||
})?;
|
||||
// Take first frame and copy owned buffer to avoid borrow across second capture
|
||||
let (is_bgr, w, first_buf): (bool, usize, Vec<u8>) =
|
||||
@@ -1729,7 +1802,89 @@ fn sort_streams(
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::stage_err;
|
||||
use super::{corrected_origin, reconciled_origin, stage_err, WaylandDisplayInfo};
|
||||
|
||||
fn output(x: i32, y: i32, mode: (i32, i32)) -> WaylandDisplayInfo {
|
||||
WaylandDisplayInfo {
|
||||
name: String::new(),
|
||||
x,
|
||||
y,
|
||||
width: mode.0,
|
||||
height: mode.1,
|
||||
logical_size: None,
|
||||
refresh_rate: 60,
|
||||
transform: 0,
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_portal_position_naming_no_output_of_its_size_moves_to_the_only_one() {
|
||||
// 1920x1080 at the origin, 2880x1800 to its right: xdph puts the right one at (0, 0).
|
||||
let pair = [output(0, 0, (1920, 1080)), output(1920, 0, (2880, 1800))];
|
||||
assert_eq!(
|
||||
corrected_origin((0, 0), (2880, 1800), &pair),
|
||||
Some((1920, 0))
|
||||
);
|
||||
// A real origin is kept.
|
||||
assert_eq!(corrected_origin((1920, 0), (2880, 1800), &pair), None);
|
||||
// Nothing starts at the origin (the hyprland layout in #15731).
|
||||
let three = [
|
||||
output(0, 120, (1920, 1200)),
|
||||
output(1920, 0, (3440, 1440)),
|
||||
output(5360, 180, (1920, 1080)),
|
||||
];
|
||||
assert_eq!(
|
||||
corrected_origin((0, 0), (3440, 1440), &three),
|
||||
Some((1920, 0))
|
||||
);
|
||||
// Two outputs of that size cannot be told apart: the position is kept.
|
||||
let twins = [
|
||||
output(0, 0, (2560, 1600)),
|
||||
output(2560, 0, (1920, 1080)),
|
||||
output(4480, 0, (1920, 1080)),
|
||||
];
|
||||
assert_eq!(corrected_origin((0, 0), (1920, 1080), &twins), None);
|
||||
// A portrait panel turned to landscape keeps its position next to a 1920x1080 output.
|
||||
let turned = [
|
||||
WaylandDisplayInfo {
|
||||
transform: 90,
|
||||
..output(0, 0, (1080, 1920))
|
||||
},
|
||||
output(1920, 0, (1920, 1080)),
|
||||
];
|
||||
assert_eq!(corrected_origin((0, 0), (1920, 1080), &turned), None);
|
||||
// A rotated output that try_fill_positions could not match by its mode is found in its
|
||||
// delivered orientation.
|
||||
let turned_right = [
|
||||
output(0, 0, (2560, 1440)),
|
||||
WaylandDisplayInfo {
|
||||
transform: 90,
|
||||
..output(2560, 0, (1080, 1920))
|
||||
},
|
||||
];
|
||||
assert_eq!(
|
||||
corrected_origin((0, 0), (1920, 1080), &turned_right),
|
||||
Some((2560, 0))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_cached_position_is_not_overridden_by_an_unmeasured_size() {
|
||||
let outputs = [output(0, 0, (1440, 900)), output(1920, 0, (2880, 1800))];
|
||||
// Restored from the cache, or sent by the portal: get_res() failed, so the size is the
|
||||
// portal size, here the mode of the other output, and it moves nothing.
|
||||
assert_eq!(
|
||||
reconciled_origin((1920, 0), (1440, 900), false, &outputs),
|
||||
None
|
||||
);
|
||||
// A measured size still moves a position that names no output of that size: xdph sends
|
||||
// (0, 0) for every stream.
|
||||
let pair = [output(0, 0, (1920, 1080)), output(1920, 0, (2880, 1800))];
|
||||
assert_eq!(
|
||||
reconciled_origin((0, 0), (2880, 1800), true, &pair),
|
||||
Some((1920, 0))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn stage_err_keeps_the_detail_safe_for_a_placeholder() {
|
||||
|
||||
@@ -14,3 +14,4 @@ EXPORTS
|
||||
RemoveAmyuniIdd
|
||||
InstallPrinter
|
||||
UninstallPrinter
|
||||
SetPrinterInstallDefault
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <Windows.h>
|
||||
#include <winspool.h>
|
||||
#include <setupapi.h>
|
||||
#include <strutil.h>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <functional>
|
||||
@@ -356,6 +357,42 @@ namespace RemotePrinter
|
||||
return EnumPrintersW(PRINTER_ENUM_LOCAL, NULL, level, pPrinterInfo, cbBuf, pcbNeeded, pcReturned);
|
||||
}
|
||||
|
||||
static HRESULT queryPrinterPresence(LPCWSTR name)
|
||||
{
|
||||
constexpr DWORD printerInfoLevel = 1;
|
||||
DWORD needed = 0;
|
||||
DWORD returned = 0;
|
||||
if (!enumLocalPrinter(printerInfoLevel, NULL, 0, &needed, &returned))
|
||||
{
|
||||
const DWORD error = GetLastError();
|
||||
if (error != ERROR_INSUFFICIENT_BUFFER || needed == 0)
|
||||
{
|
||||
return error == ERROR_SUCCESS ? E_FAIL : HRESULT_FROM_WIN32(error);
|
||||
}
|
||||
}
|
||||
if (needed == 0)
|
||||
{
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
std::vector<BYTE> buffer(needed);
|
||||
if (!enumLocalPrinter(printerInfoLevel, buffer.data(), needed, &needed, &returned))
|
||||
{
|
||||
const DWORD error = GetLastError();
|
||||
return error == ERROR_SUCCESS ? E_FAIL : HRESULT_FROM_WIN32(error);
|
||||
}
|
||||
|
||||
const auto printers = reinterpret_cast<const PRINTER_INFO_1W *>(buffer.data());
|
||||
for (DWORD i = 0; i < returned; i++)
|
||||
{
|
||||
if (isNameEqual(name, printers[i].pName))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
BOOL isPrinterAdded(LPCWSTR name)
|
||||
{
|
||||
auto onData = [name](const PRINTER_INFO_1W &info)
|
||||
@@ -528,3 +565,32 @@ namespace RemotePrinter
|
||||
WcaLog(LOGMSG_STANDARD, "Deleted the local port\n");
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" UINT __stdcall SetPrinterInstallDefault(__in MSIHANDLE hInstall)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
LPWSTR appName = NULL;
|
||||
|
||||
hr = WcaInitialize(hInstall, "SetPrinterInstallDefault");
|
||||
ExitOnFailure(hr, "Failed to initialize printer detection");
|
||||
|
||||
hr = WcaGetProperty(L"ProductName", &appName);
|
||||
ExitOnFailure(hr, "Failed to get the printer's application name");
|
||||
|
||||
hr = RemotePrinter::queryPrinterPresence(RemotePrinter::printerNameOf(appName).c_str());
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WcaLog(LOGMSG_STANDARD, "Failed to detect the existing printer (0x%08X); skipping printer installation.", static_cast<UINT>(hr));
|
||||
}
|
||||
|
||||
if (hr != S_OK)
|
||||
{
|
||||
hr = WcaSetProperty(L"INSTALLPRINTER", L"0");
|
||||
ExitOnFailure(hr, "Failed to disable printer installation");
|
||||
WcaLog(LOGMSG_STANDARD, "The application's printer was not confirmed present; leaving printer installation disabled by default.");
|
||||
}
|
||||
|
||||
LExit:
|
||||
ReleaseStr(appName);
|
||||
return WcaFinalize(SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE);
|
||||
}
|
||||
|
||||
@@ -74,13 +74,22 @@
|
||||
<SetProperty Action="RestoreSavedDesktopShortcutsValue" Id="CREATEDESKTOPSHORTCUTS" Value="[SavedDesktopShortcutsCmdLineValue]" After="AppSearch" Sequence="first" Condition="SavedDesktopShortcutsCmdLineValue" />
|
||||
<SetProperty Action="RestoreSavedPrinterValue" Id="INSTALLPRINTER" Value="[SavedPrinterCmdLineValue]" After="AppSearch" Sequence="first" Condition="SavedPrinterCmdLineValue" />
|
||||
|
||||
<!-- Check before the old product removes its printer. firstSequence preserves later UI choices. -->
|
||||
<CustomAction Id="SetPrinterInstallDefault" DllEntry="SetPrinterInstallDefault" Execute="firstSequence" Return="check" BinaryRef="Custom_Actions_Dll" />
|
||||
<InstallUISequence>
|
||||
<Custom Action="SetPrinterInstallDefault" After="RestoreSavedPrinterValue" Condition="WIX_UPGRADE_DETECTED AND NOT SavedPrinterCmdLineValue AND (INSTALLPRINTER = 1 OR INSTALLPRINTER = "Y" OR INSTALLPRINTER = "y")" />
|
||||
</InstallUISequence>
|
||||
<InstallExecuteSequence>
|
||||
<Custom Action="SetPrinterInstallDefault" After="RestoreSavedPrinterValue" Condition="WIX_UPGRADE_DETECTED AND NOT SavedPrinterCmdLineValue AND (INSTALLPRINTER = 1 OR INSTALLPRINTER = "Y" OR INSTALLPRINTER = "y")" />
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<!-- If a command line value or registry value was set, update the main properties with the value -->
|
||||
<SetProperty Id="STARTMENUSHORTCUTS" Value="" After="RestoreSavedStartMenuShortcutsValue" Sequence="first" Condition="CREATESTARTMENUSHORTCUTS AND NOT (CREATESTARTMENUSHORTCUTS = 1 OR CREATESTARTMENUSHORTCUTS = "Y" OR CREATESTARTMENUSHORTCUTS = "y")" />
|
||||
<SetProperty Id="DESKTOPSHORTCUTS" Value="" After="RestoreSavedDesktopShortcutsValue" Sequence="first" Condition="CREATEDESKTOPSHORTCUTS AND NOT (CREATEDESKTOPSHORTCUTS = 1 OR CREATEDESKTOPSHORTCUTS = "Y" OR CREATEDESKTOPSHORTCUTS = "y")" />
|
||||
<!-- PRINTER defaults to empty now, so a saved or command-line INSTALLPRINTER=1
|
||||
must explicitly enable the main PRINTER property. Non-truthy INSTALLPRINTER
|
||||
values still clear PRINTER so upgrades preserve an explicit disabled choice. -->
|
||||
<SetProperty Action="SetPrinterValueEnabled" Id="PRINTER" Value="1" After="RestoreSavedPrinterValue" Sequence="first" Condition="INSTALLPRINTER = 1 OR INSTALLPRINTER = "Y" OR INSTALLPRINTER = "y"" />
|
||||
<SetProperty Action="SetPrinterValueEnabled" Id="PRINTER" Value="1" After="SetPrinterInstallDefault" Sequence="first" Condition="INSTALLPRINTER = 1 OR INSTALLPRINTER = "Y" OR INSTALLPRINTER = "y"" />
|
||||
<SetProperty Action="SetPrinterValueDisabled" Id="PRINTER" Value="" After="SetPrinterValueEnabled" Sequence="first" Condition="INSTALLPRINTER AND NOT (INSTALLPRINTER = 1 OR INSTALLPRINTER = "Y" OR INSTALLPRINTER = "y")" />
|
||||
|
||||
</Fragment>
|
||||
|
||||
@@ -4467,6 +4467,32 @@ fn _input_os_password(p: String, activate: bool, interface: impl Interface) {
|
||||
interface.send(Data::Message(msg_out));
|
||||
}
|
||||
|
||||
/// Auto Login. A peer that can check for its logon or lock screen gets the password and types it
|
||||
/// itself, only if it is there right then. Keys typed from here land in whatever has focus if the
|
||||
/// screen is not locked by the time they arrive.
|
||||
pub fn auto_login(p: String, pi: &PeerInfo, interface: impl Interface) {
|
||||
if !is_peer_handling_os_login(pi) {
|
||||
input_os_password(p, true, interface);
|
||||
return;
|
||||
}
|
||||
std::thread::spawn(move || {
|
||||
activate_os(&interface, true);
|
||||
std::thread::sleep(Duration::from_millis(1200));
|
||||
let mut msg_out = Message::new();
|
||||
msg_out.set_os_login(OSLogin {
|
||||
password: p,
|
||||
..Default::default()
|
||||
});
|
||||
interface.send(Data::Message(msg_out));
|
||||
});
|
||||
}
|
||||
|
||||
/// Windows and macOS peers from the 1.5.1 release handle `os_login`.
|
||||
fn is_peer_handling_os_login(pi: &PeerInfo) -> bool {
|
||||
(pi.platform == crate::common::PLATFORM_WINDOWS || pi.platform == crate::common::PLATFORM_MACOS)
|
||||
&& hbb_common::get_version_number(&pi.version) >= hbb_common::get_version_number("1.5.1")
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
struct LoginErrorMsgBox {
|
||||
msgtype: &'static str,
|
||||
|
||||
@@ -737,13 +737,6 @@ async fn test_nat_type_() -> ResultType<bool> {
|
||||
} else {
|
||||
port2 = tnr.port;
|
||||
}
|
||||
if let Some(cu) = tnr.cu.as_ref() {
|
||||
Config::set_option(
|
||||
"rendezvous-servers".to_owned(),
|
||||
cu.rendezvous_servers.join(","),
|
||||
);
|
||||
Config::set_serial(cu.serial);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
|
||||
+7
-1
@@ -267,6 +267,8 @@ pub enum DataKeyboard {
|
||||
#[serde(tag = "t", content = "c")]
|
||||
pub enum DataKeyboardResponse {
|
||||
GetKeyState(bool),
|
||||
#[cfg(target_os = "linux")]
|
||||
GetKeyStateError(String),
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
@@ -513,13 +515,17 @@ pub enum Data {
|
||||
CmWindowClosed,
|
||||
// --- DRM/KMS capture (opt-in `drm` feature) over the `_drm` service-scoped channel ---
|
||||
// All of the following are `cfg(all(linux, drm))`, so the drm-off IPC wire is byte-identical
|
||||
// to upstream. Protocol on `_drm`: on connect the root service sends `DrmDisplayList`, the
|
||||
// to upstream. `_drm` protocol: the client sends `DrmHello`, the service `DrmDisplayList`, the
|
||||
// client replies `DrmStart{display}`, then the service streams `DrmFrame` + send_raw(BGRA) and
|
||||
// `DrmCursor` + send_raw(RGBA). A frame/cursor header is ALWAYS immediately followed by exactly
|
||||
// one `send_raw()` payload (the same header-then-raw pairing as `FileBlockFromCM`). This keeps
|
||||
// the header extensible. The zero-copy `DrmFrameDmabuf(DmabufDesc)` sibling below carries only a
|
||||
// small JSON metadata descriptor; the scanout dma-buf fd rides an SCM_RIGHTS ancillary message on
|
||||
// the same `DrmConn` send (see `DrmConn::send_msg`), so it has NO trailing `send_raw()` body.
|
||||
/// Client -> service, first on `_drm`: whether the service may wake sleeping displays before
|
||||
/// it answers. The cache warm at every `--server` start says no: no peer is waiting for it.
|
||||
#[cfg(all(target_os = "linux", feature = "drm"))]
|
||||
DrmHello { wake: bool },
|
||||
/// Client -> service: begin streaming the chosen display.
|
||||
#[cfg(all(target_os = "linux", feature = "drm"))]
|
||||
// `need_cpu` is set by an unprivileged consumer that could not open a render-node convert context
|
||||
|
||||
+58
-2
@@ -23,6 +23,10 @@ pub struct DrmDisplayInfo {
|
||||
/// alone is ambiguous across cards. Empty = the single auto-detected device.
|
||||
#[serde(default)]
|
||||
pub device: String,
|
||||
/// The primary plane rotates its framebuffer by 90/270 in hardware, so every frame is this
|
||||
/// mode TRANSPOSED whatever the compositor reports (gamescope's wl_output has no transform).
|
||||
#[serde(default)]
|
||||
pub plane_transposed: bool,
|
||||
}
|
||||
|
||||
/// Mirrors `scrap::drm_reader::drmtap_dmabuf_desc` except `dma_buf_fd` (never serializes — it rides
|
||||
@@ -280,6 +284,7 @@ fn drm_displays_from_reader(
|
||||
true
|
||||
})
|
||||
.map(|d| DrmDisplayInfo {
|
||||
plane_transposed: plane_transposed(device, d.crtc_id),
|
||||
name: d.name,
|
||||
crtc_id: d.crtc_id,
|
||||
x: d.x,
|
||||
@@ -294,6 +299,33 @@ fn drm_displays_from_reader(
|
||||
(displays, undriven)
|
||||
}
|
||||
|
||||
const DRM_MODE_ROTATE_90: u32 = 0x2;
|
||||
const DRM_MODE_ROTATE_270: u32 = 0x8;
|
||||
|
||||
/// Through a reader bound to `crtc_id`: the enumerating reader is bound to whichever crtc
|
||||
/// auto-select picked.
|
||||
fn plane_transposed(device: &str, crtc_id: u32) -> bool {
|
||||
let dev = (!device.is_empty()).then_some(device);
|
||||
let Some(mut r) = scrap::drm_reader::DrmReader::open(dev, crtc_id) else {
|
||||
return false;
|
||||
};
|
||||
let transposed = match r.query_plane_rotation() {
|
||||
Some(m) => m & (DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_270) != 0,
|
||||
None => {
|
||||
hbb_common::throttled_log!(
|
||||
std::time::Duration::from_secs(600),
|
||||
debug,
|
||||
"drm: crtc {crtc_id} ({device:?}): plane rotation unreadable; sized as unrotated"
|
||||
);
|
||||
false
|
||||
}
|
||||
};
|
||||
if transposed {
|
||||
log::trace!("drm: crtc {crtc_id} ({device:?}) is rotated 90/270 by its plane");
|
||||
}
|
||||
transposed
|
||||
}
|
||||
|
||||
/// Active displays of every DRM device + the connected-but-undriven identities, from ONE look.
|
||||
fn drm_enumerate_all_displays() -> (Vec<DrmDisplayInfo>, Vec<String>) {
|
||||
if let Some(devices) = scrap::drm_reader::list_devices() {
|
||||
@@ -914,6 +946,20 @@ async fn handle_drm_conn(stream: Connection) -> ResultType<()> {
|
||||
let mut conn = dup_to_drm_conn(&stream)?;
|
||||
drop(stream);
|
||||
|
||||
let wake = match conn.recv_msg_timeout2(3_000).await {
|
||||
Some(Ok((Data::DrmHello { wake }, _fd))) => wake,
|
||||
Some(Ok((_, _fd))) => {
|
||||
hbb_common::throttled_log!(
|
||||
std::time::Duration::from_secs(5),
|
||||
info,
|
||||
"drm: peer did not open with DrmHello; closing"
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
Some(Err(e)) => return Err(e),
|
||||
None => return Ok(()),
|
||||
};
|
||||
|
||||
let (frame_tx, mut frame_rx) = tokio::sync::mpsc::channel::<DrmProducerMsg>(2);
|
||||
let (crtc_tx, crtc_rx) = std::sync::mpsc::channel::<(String, u32, bool)>();
|
||||
let stop = Arc::new(AtomicBool::new(false));
|
||||
@@ -923,7 +969,7 @@ async fn handle_drm_conn(stream: Connection) -> ResultType<()> {
|
||||
let worker_gate = frames_gated.clone();
|
||||
std::thread::Builder::new()
|
||||
.name("drm-capture".into())
|
||||
.spawn(move || drm_capture_worker(frame_tx, crtc_rx, worker_stop, worker_gate))
|
||||
.spawn(move || drm_capture_worker(frame_tx, crtc_rx, worker_stop, worker_gate, wake))
|
||||
.map_err(|err| anyhow::anyhow!("could not spawn the drm capture worker: {err}"))?;
|
||||
|
||||
let displays = match frame_rx.recv().await {
|
||||
@@ -1108,6 +1154,7 @@ fn drm_capture_worker(
|
||||
crtc_rx: std::sync::mpsc::Receiver<(String, u32, bool)>,
|
||||
stop: std::sync::Arc<std::sync::atomic::AtomicBool>,
|
||||
frames_gated: std::sync::Arc<std::sync::atomic::AtomicBool>,
|
||||
wake: bool,
|
||||
) {
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::time::Duration;
|
||||
@@ -1118,7 +1165,15 @@ fn drm_capture_worker(
|
||||
let t_conn = std::time::Instant::now();
|
||||
|
||||
// Enumerate FRESH rather than serve the cache: a cached display may no longer be driven.
|
||||
let displays = drm_enumerate_settled("a consumer connected");
|
||||
let displays = if wake {
|
||||
drm_enumerate_settled("a consumer connected")
|
||||
} else {
|
||||
let (displays, _undriven) = drm_enumerate_all_displays();
|
||||
// Seen lit, a connector a failed wake gave up on is wakeable again.
|
||||
#[cfg(feature = "drm-wake")]
|
||||
drm_wakeable_undriven(&displays, &_undriven);
|
||||
displays
|
||||
};
|
||||
if frame_tx
|
||||
.blocking_send(DrmProducerMsg::Displays(displays))
|
||||
.is_err()
|
||||
@@ -1650,6 +1705,7 @@ mod drm_conn_tests {
|
||||
active: true,
|
||||
render_node: "/dev/dri/renderD129".to_owned(),
|
||||
device: "/dev/dri/card2".to_owned(),
|
||||
plane_transposed: false,
|
||||
};
|
||||
let wire = serde_json::to_vec(¤t).unwrap();
|
||||
let back: DrmDisplayInfo = serde_json::from_slice(&wire).unwrap();
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "تعذّر على RustDesk تحميل مكوّن GStreamer اللازم لالتقاط الشاشة ({})"),
|
||||
("Relay fallback delay in seconds", "مهلة التراجع إلى الترحيل بالثواني"),
|
||||
("relay-fallback-delay-tip", "المدة التي ينتظرها اتصال الترحيل القائم بالفعل الاتصالَ المباشر عبر WebRTC قبل أن يُستخدم بدلًا منه. زِدها لمنح الاتصال المباشر البطيء فرصة أكبر للفوز؛ وقلّلها للاستقرار على الترحيل أسرع في الشبكات التي يتعذر فيها الاتصال المباشر. اتركها فارغة للقيمة الافتراضية 2.5 ثانية."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", ""),
|
||||
("Relay fallback delay in seconds", "Ötürücüyə keçid gecikməsi, saniyə"),
|
||||
("relay-fallback-delay-tip", "Artıq qurulmuş ötürücü bağlantı birbaşa WebRTC bağlantısını nə qədər gözləyir, sonra onun əvəzinə istifadə olunur. Yavaş birbaşa bağlantıya daha çox vaxt vermək üçün artırın; birbaşa bağlantının mümkün olmadığı şəbəkələrdə ötürücüyə daha tez keçmək üçün azaldın. Standart 2.5 saniyə üçün boş buraxın."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk не змог загрузіць кампанент GStreamer, патрэбны для захопу экрана ({})"),
|
||||
("Relay fallback delay in seconds", "Затрымка пераходу на рэтранслятар у секундах"),
|
||||
("relay-fallback-delay-tip", "Колькі часу ўжо ўсталяванае злучэнне праз рэтранслятар чакае прамога злучэння WebRTC, перш чым будзе выкарыстана замест яго. Павялічце, каб даць павольнаму прамому злучэнню больш часу; паменшыце, каб хутчэй пераходзіць на рэтранслятар у сетках, дзе прамое злучэнне немагчымае. Пакіньце пустым для значэння па змаўчанні 2.5 секунды."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk не можа да зареди компонент на GStreamer, необходим за заснемане на екрана ({})"),
|
||||
("Relay fallback delay in seconds", "Забавяне преди преминаване към препредаване в секунди"),
|
||||
("relay-fallback-delay-tip", "Колко време вече установената връзка чрез препредаване изчаква директната WebRTC връзка, преди да бъде използвана вместо нея. Увеличете, за да дадете повече време на бавна директна връзка; намалете, за да се премине по-бързо към препредаване в мрежи, където директна връзка е невъзможна. Оставете празно за стойността по подразбиране 2.5 секунди."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "El RustDesk no ha pogut carregar un component del GStreamer necessari per capturar la pantalla ({})"),
|
||||
("Relay fallback delay in seconds", "Retard abans de recórrer al relé en segons"),
|
||||
("relay-fallback-delay-tip", "Quant de temps espera una connexió de relé ja establerta la connexió directa WebRTC abans d'utilitzar-se en lloc seu. Augmenteu-lo per donar més temps a una connexió directa lenta; reduïu-lo per passar abans al relé en xarxes on no es pot fer una connexió directa. Deixeu-lo buit per al valor predeterminat de 2.5 segons."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk 无法加载屏幕捕获所需的 GStreamer 组件 ({})"),
|
||||
("Relay fallback delay in seconds", "回落到中继前的等待时间(秒)"),
|
||||
("relay-fallback-delay-tip", "已经建立的中继连接会等待直连的 WebRTC 多久,超过这个时间就改用中继。调大可以让较慢的直连有更多机会胜出;调小则在无法直连的网络上更快回落到中继。留空表示使用默认值 2.5 秒。"),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "开始语音通话前请在\"仅共享屏幕\"页面启用\"音频录制\"。")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "开始语音通话前请在\"共享屏幕\"页面启用\"音频录制\"。")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk nemohl načíst komponentu GStreameru potřebnou k zachycení obrazovky ({})"),
|
||||
("Relay fallback delay in seconds", "Prodleva před přepnutím na přenos v sekundách"),
|
||||
("relay-fallback-delay-tip", "Jak dlouho již navázané spojení přes přenos čeká na přímé spojení WebRTC, než bude použito místo něj. Zvyšte, aby pomalé přímé spojení mělo více času uspět; snižte, aby se v sítích, kde přímé spojení není možné, dříve přešlo na přenos. Ponechte prázdné pro výchozí hodnotu 2.5 sekundy."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk kunne ikke indlæse en GStreamer-komponent, der kræves til skærmoptagelse ({})"),
|
||||
("Relay fallback delay in seconds", "Forsinkelse før brug af relæ i sekunder"),
|
||||
("relay-fallback-delay-tip", "Hvor længe en allerede oprettet relæforbindelse venter på den direkte WebRTC-forbindelse, før den bruges i stedet. Forøg for at give en langsom direkte forbindelse mere tid; sænk for hurtigere at falde tilbage til relæet på netværk, hvor en direkte forbindelse ikke kan oprettes. Lad feltet stå tomt for standardværdien 2.5 sekunder."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk konnte eine für die Bildschirmaufnahme benötigte GStreamer-Komponente nicht laden ({})"),
|
||||
("Relay fallback delay in seconds", "Verzögerung bis zum Relais in Sekunden"),
|
||||
("relay-fallback-delay-tip", "Wie lange eine bereits aufgebaute Relaisverbindung auf die direkte WebRTC-Verbindung wartet, bevor sie stattdessen verwendet wird. Erhöhen Sie den Wert, um einer langsamen direkten Verbindung mehr Zeit zu geben; verringern Sie ihn, um in Netzwerken ohne mögliche Direktverbindung schneller auf das Relais zurückzufallen. Leer lassen für den Standardwert von 2.5 Sekunden."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "Το RustDesk δεν μπόρεσε να φορτώσει ένα στοιχείο του GStreamer που απαιτείται για την καταγραφή οθόνης ({})"),
|
||||
("Relay fallback delay in seconds", "Καθυστέρηση πριν από τη χρήση αναμεταδότη σε δευτερόλεπτα"),
|
||||
("relay-fallback-delay-tip", "Πόσο χρόνο περιμένει μια ήδη ενεργή σύνδεση αναμεταδότη την απευθείας σύνδεση WebRTC πριν χρησιμοποιηθεί στη θέση της. Αυξήστε το για να δώσετε σε μια αργή απευθείας σύνδεση περισσότερο χρόνο. Μειώστε το για ταχύτερη επιστροφή στον αναμεταδότη σε δίκτυα όπου δεν είναι δυνατή η απευθείας σύνδεση. Αφήστε το κενό για την προεπιλογή των 2.5 δευτερολέπτων."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk ne povis ŝargi komponanton de GStreamer necesan por ekrankapto ({})"),
|
||||
("Relay fallback delay in seconds", "Prokrasto antaŭ retransmisio en sekundoj"),
|
||||
("relay-fallback-delay-tip", "Kiom longe jam establita retransmisia konekto atendas la rektan WebRTC-konekton antaŭ ol esti uzata anstataŭe. Pligrandigu ĝin por doni al malrapida rekta konekto pli da tempo; malpligrandigu ĝin por pli frue uzi la retransmision en retoj kie rekta konekto ne eblas. Lasu malplena por la defaŭlta valoro de 2.5 sekundoj."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk no ha podido cargar un componente de GStreamer necesario para capturar la pantalla ({})"),
|
||||
("Relay fallback delay in seconds", "Retardo antes de usar el relé en segundos"),
|
||||
("relay-fallback-delay-tip", "Cuánto tiempo espera una conexión de relé ya establecida a la conexión directa WebRTC antes de usarse en su lugar. Auméntelo para dar más tiempo a una conexión directa lenta; redúzcalo para recurrir antes al relé en redes donde no es posible una conexión directa. Déjelo vacío para el valor predeterminado de 2.5 segundos."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "Para comenzar una llamada de voz activar \"Captura de audio\" en la página \"Compartir pantalla\".")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Para comenzar una llamada de voz activar \"Captura de audio\" en la página \"Compartir pantalla\".")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk ei suutnud laadida ekraani jäädvustamiseks vajalikku GStreameri komponenti ({})"),
|
||||
("Relay fallback delay in seconds", "Viivitus enne relee kasutamist sekundites"),
|
||||
("relay-fallback-delay-tip", "Kui kaua juba loodud releeühendus ootab otsest WebRTC-ühendust, enne kui seda selle asemel kasutatakse. Suurendage, et anda aeglasele otseühendusele rohkem aega; vähendage, et võrkudes, kus otseühendust luua ei saa, releele kiiremini üle minna. Jätke tühjaks vaikeväärtuse 2.5 sekundit kasutamiseks."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk-ek ezin izan du pantaila kapturatzeko beharrezkoa den GStreamer osagai bat kargatu ({})"),
|
||||
("Relay fallback delay in seconds", "Errelera itzultzeko atzerapena segundotan"),
|
||||
("relay-fallback-delay-tip", "Dagoeneko ezarritako errele-konexio batek WebRTC konexio zuzenari zenbat denbora itxaroten dion, haren ordez erabili aurretik. Handitu konexio zuzen motel bati denbora gehiago emateko; txikitu konexio zuzena egin ezin den sareetan lehenago errelera itzultzeko. Utzi hutsik 2.5 segundoko balio lehenetsirako."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk نتوانست مؤلفه GStreamer موردنیاز برای ضبط صفحه را بارگذاری کند ({})"),
|
||||
("Relay fallback delay in seconds", "تأخیر بازگشت به رله بر حسب ثانیه"),
|
||||
("relay-fallback-delay-tip", "یک اتصال رله که از قبل برقرار شده چقدر منتظر اتصال مستقیم WebRTC می ماند پیش از آنکه به جای آن استفاده شود. آن را افزایش دهید تا به اتصال مستقیم کند فرصت بیشتری داده شود؛ کاهش دهید تا در شبکه هایی که اتصال مستقیم ممکن نیست، زودتر به رله بازگردد. برای مقدار پیش فرض 2.5 ثانیه خالی بگذارید."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk ei voinut ladata näytön kaappaukseen tarvittavaa GStreamer-osaa ({})"),
|
||||
("Relay fallback delay in seconds", "Viive ennen välitykseen siirtymistä sekunteina"),
|
||||
("relay-fallback-delay-tip", "Kuinka kauan jo muodostettu välitysyhteys odottaa suoraa WebRTC-yhteyttä ennen kuin sitä käytetään sen sijaan. Kasvata arvoa antaaksesi hitaalle suoralle yhteydelle enemmän aikaa; pienennä sitä siirtyäksesi nopeammin välitykseen verkoissa, joissa suoraa yhteyttä ei voi muodostaa. Jätä tyhjäksi käyttääksesi oletusarvoa 2.5 sekuntia."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk n'a pas pu charger un composant GStreamer nécessaire à la capture d'écran ({})"),
|
||||
("Relay fallback delay in seconds", "Délai avant bascule vers le relais en secondes"),
|
||||
("relay-fallback-delay-tip", "Durée pendant laquelle une connexion relais déjà établie attend la connexion directe WebRTC avant d'être utilisée à sa place. Augmentez-la pour laisser plus de temps à une connexion directe lente ; diminuez-la pour basculer plus tôt vers le relais sur les réseaux où une connexion directe est impossible. Laissez vide pour la valeur par défaut de 2.5 secondes."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk-მა ვერ ჩატვირთა ეკრანის ჩაწერისთვის საჭირო GStreamer-ის კომპონენტი ({})"),
|
||||
("Relay fallback delay in seconds", "რელეზე გადასვლის დაყოვნება წამებში"),
|
||||
("relay-fallback-delay-tip", "რამდენ ხანს ელოდება უკვე დამყარებული რელე-კავშირი პირდაპირ WebRTC კავშირს, სანამ მის ნაცვლად გამოიყენება. გაზარდეთ, რომ ნელ პირდაპირ კავშირს მეტი დრო მისცეთ; შეამცირეთ, რომ ქსელებში, სადაც პირდაპირი კავშირი შეუძლებელია, უფრო სწრაფად გადავიდეს რელეზე. დატოვეთ ცარიელი ნაგულისხმევი 2.5 წამისთვის."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk non puido cargar un compoñente de GStreamer necesario para capturar a pantalla ({})"),
|
||||
("Relay fallback delay in seconds", "Atraso antes de usar o relé en segundos"),
|
||||
("relay-fallback-delay-tip", "Canto tempo agarda unha conexión de relé xa establecida pola conexión directa WebRTC antes de usarse no seu lugar. Auménteo para darlle máis tempo a unha conexión directa lenta; redúzao para recorrer antes ao relé en redes onde non é posible unha conexión directa. Déixeo baleiro para o valor predeterminado de 2.5 segundos."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk સ્ક્રીન કૅપ્ચર માટે જરૂરી GStreamer ઘટક લોડ કરી શક્યું નથી ({})"),
|
||||
("Relay fallback delay in seconds", "રિલે પર પાછા ફરવામાં વિલંબ સેકન્ડમાં"),
|
||||
("relay-fallback-delay-tip", "પહેલેથી સ્થાપિત રિલે કનેક્શન સીધા WebRTC કનેક્શનની કેટલો સમય રાહ જુએ છે, ત્યાર બાદ તેના બદલે વપરાય છે. ધીમા સીધા કનેક્શનને વધુ સમય આપવા માટે વધારો; જ્યાં સીધું કનેક્શન શક્ય નથી તેવા નેટવર્ક પર વહેલા રિલે પર જવા માટે ઘટાડો. મૂળભૂત 2.5 સેકન્ડ માટે ખાલી રાખો."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk לא הצליח לטעון רכיב GStreamer הדרוש ללכידת מסך ({})"),
|
||||
("Relay fallback delay in seconds", "השהיה לפני מעבר לממסר בשניות"),
|
||||
("relay-fallback-delay-tip", "כמה זמן חיבור ממסר שכבר נוצר ממתין לחיבור WebRTC הישיר לפני שישמש במקומו. הגדל כדי לתת לחיבור ישיר איטי יותר זמן; הקטן כדי לעבור מהר יותר לממסר ברשתות שבהן לא ניתן ליצור חיבור ישיר. השאר ריק לערך ברירת המחדל של 2.5 שניות."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk स्क्रीन कैप्चर के लिए आवश्यक GStreamer घटक लोड नहीं कर सका ({})"),
|
||||
("Relay fallback delay in seconds", "रिले पर लौटने में विलंब सेकंड में"),
|
||||
("relay-fallback-delay-tip", "पहले से स्थापित रिले कनेक्शन सीधे WebRTC कनेक्शन की कितनी देर प्रतीक्षा करता है, उसके बाद उसके स्थान पर उपयोग किया जाता है। धीमे सीधे कनेक्शन को अधिक समय देने के लिए बढ़ाएँ; जिन नेटवर्क पर सीधा कनेक्शन संभव नहीं है वहाँ जल्दी रिले पर जाने के लिए घटाएँ। डिफ़ॉल्ट 2.5 सेकंड के लिए खाली छोड़ें।"),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk nije mogao učitati GStreamer komponentu potrebnu za snimanje zaslona ({})"),
|
||||
("Relay fallback delay in seconds", "Odgoda prije prelaska na relej u sekundama"),
|
||||
("relay-fallback-delay-tip", "Koliko dugo već uspostavljena relejna veza čeka izravnu WebRTC vezu prije nego što se upotrijebi umjesto nje. Povećajte da sporoj izravnoj vezi date više vremena; smanjite da se na mrežama gdje izravna veza nije moguća brže prijeđe na relej. Ostavite prazno za zadanu vrijednost od 2.5 sekunde."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "A RustDesk nem tudta betölteni a képernyőrögzítéshez szükséges GStreamer összetevőt ({})"),
|
||||
("Relay fallback delay in seconds", "Késleltetés a továbbítóra váltás előtt másodpercben"),
|
||||
("relay-fallback-delay-tip", "Mennyi ideig vár a már létrejött továbbító kapcsolat a közvetlen WebRTC kapcsolatra, mielőtt helyette használnák. Növelje, hogy a lassú közvetlen kapcsolatnak több ideje legyen; csökkentse, hogy olyan hálózatokon, ahol közvetlen kapcsolat nem hozható létre, hamarabb váltson továbbítóra. Hagyja üresen az alapértelmezett 2.5 másodperchez."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk tidak dapat memuat komponen GStreamer yang diperlukan untuk merekam layar ({})"),
|
||||
("Relay fallback delay in seconds", "Jeda sebelum beralih ke relai dalam detik"),
|
||||
("relay-fallback-delay-tip", "Berapa lama koneksi relai yang sudah terbentuk menunggu koneksi langsung WebRTC sebelum digunakan sebagai gantinya. Perbesar untuk memberi koneksi langsung yang lambat lebih banyak waktu; perkecil agar lebih cepat beralih ke relai pada jaringan yang tidak memungkinkan koneksi langsung. Biarkan kosong untuk nilai bawaan 2.5 detik."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk non è riuscito a caricare un componente GStreamer necessario per l'acquisizione dello schermo ({})"),
|
||||
("Relay fallback delay in seconds", "Ritardo fallback relay (secondi)"),
|
||||
("relay-fallback-delay-tip", "Quanto tempo una connessione relay già attiva attende la connessione WebRTC diretta prima di essere usata. Aumentalo per dare a una connessione diretta lenta più tempo per funzionare; diminuiscilo per passare prima al relay sulle reti in cui non è possibile effettuare una connessione diretta. Lascia vuoto per il valore predefinito di 2,5 secondi."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "Per avviare una chiamata vocale, attiva nella pagina 'Condivisione schermo' la voce 'Cattura audio'.")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Per avviare una chiamata vocale, attiva nella pagina 'Condividi schermo' la voce 'Cattura audio'.")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk は画面キャプチャに必要な GStreamer コンポーネントを読み込めませんでした ({})"),
|
||||
("Relay fallback delay in seconds", "中継に切り替えるまでの待ち時間 (秒)"),
|
||||
("relay-fallback-delay-tip", "すでに確立された中継接続が、直接の WebRTC 接続をどれだけ待ってから代わりに使用されるかを指定します。値を大きくすると遅い直接接続に時間を与えられ、小さくすると直接接続できないネットワークで早く中継に切り替わります。空欄にすると既定値の 2.5 秒になります。"),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk가 화면 캡처에 필요한 GStreamer 구성 요소를 불러오지 못했습니다 ({})"),
|
||||
("Relay fallback delay in seconds", "릴레이 대체 작동 지연 시간 (초)"),
|
||||
("relay-fallback-delay-tip", "이미 연결된 중계 연결이 직접 WebRTC 연결을 얼마나 기다린 후 대신 사용되는지입니다. 값을 늘리면 느린 직접 연결에 더 많은 시간을 주고, 줄이면 직접 연결이 불가능한 네트워크에서 더 빨리 중계로 전환합니다. 비워 두면 기본값 2.5초가 사용됩니다."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "음성 통화를 시작하려면 '화면 공유' 페이지에서 '오디오 캡처'를 사용함으로 하세요.")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "음성 통화를 시작하려면 '화면 공유' 페이지에서 '오디오 캡처'를 사용함으로 하세요.")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk экранды түсіру үшін қажет GStreamer компонентін жүктей алмады ({})"),
|
||||
("Relay fallback delay in seconds", "Релеге ауысу кідірісі, секундпен"),
|
||||
("relay-fallback-delay-tip", "Бұрыннан орнатылған реле байланысы тікелей WebRTC байланысын қанша уақыт күтеді, содан кейін оның орнына қолданылады. Баяу тікелей байланысқа көбірек уақыт беру үшін үлкейтіңіз; тікелей байланыс мүмкін емес желілерде релеге тезірек ауысу үшін кішірейтіңіз. Әдепкі 2.5 секунд үшін бос қалдырыңыз."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk nepavyko įkelti ekrano įrašymui reikalingo GStreamer komponento ({})"),
|
||||
("Relay fallback delay in seconds", "Delsa prieš pereinant prie perdavimo sekundėmis"),
|
||||
("relay-fallback-delay-tip", "Kiek laiko jau užmegztas perdavimo ryšys laukia tiesioginio WebRTC ryšio, kol bus panaudotas vietoj jo. Padidinkite, kad lėtam tiesioginiam ryšiui būtų skirta daugiau laiko; sumažinkite, kad tinkluose, kuriuose tiesioginis ryšys neįmanomas, greičiau būtų pereinama prie perdavimo. Palikite tuščią numatytajai 2.5 sekundės reikšmei."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk nevarēja ielādēt ekrāna tveršanai nepieciešamo GStreamer komponentu ({})"),
|
||||
("Relay fallback delay in seconds", "Aizkave pirms pārslēgšanās uz retranslatoru sekundēs"),
|
||||
("relay-fallback-delay-tip", "Cik ilgi jau izveidots retranslatora savienojums gaida tiešo WebRTC savienojumu, pirms tiek izmantots tā vietā. Palieliniet, lai lēnam tiešajam savienojumam dotu vairāk laika; samaziniet, lai tīklos, kur tiešais savienojums nav iespējams, ātrāk pārslēgtos uz retranslatoru. Atstājiet tukšu noklusējuma 2.5 sekunžu vērtībai."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "സ്ക്രീൻ പകർത്താൻ ആവശ്യമായ GStreamer ഘടകം RustDesk-ന് ലോഡ് ചെയ്യാനായില്ല ({})"),
|
||||
("Relay fallback delay in seconds", "റിലേയിലേക്ക് മാറുന്നതിനുള്ള കാലതാമസം സെക്കൻഡിൽ"),
|
||||
("relay-fallback-delay-tip", "ഇതിനകം സ്ഥാപിതമായ റിലേ കണക്ഷൻ നേരിട്ടുള്ള WebRTC കണക്ഷനായി എത്ര നേരം കാത്തിരിക്കുന്നു, അതിനുശേഷം അതിനുപകരം ഉപയോഗിക്കുന്നു. മന്ദഗതിയിലുള്ള നേരിട്ടുള്ള കണക്ഷന് കൂടുതൽ സമയം നൽകാൻ വർദ്ധിപ്പിക്കുക; നേരിട്ടുള്ള കണക്ഷൻ സാധ്യമല്ലാത്ത നെറ്റ്വർക്കുകളിൽ വേഗത്തിൽ റിലേയിലേക്ക് മാറാൻ കുറയ്ക്കുക. സ്ഥിരസ്ഥിതിയായ 2.5 സെക്കൻഡിനായി ശൂന്യമാക്കിയിടുക."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk kunne ikke laste en GStreamer-komponent som kreves for skjermopptak ({})"),
|
||||
("Relay fallback delay in seconds", "Forsinkelse før bruk av relé i sekunder"),
|
||||
("relay-fallback-delay-tip", "Hvor lenge en allerede opprettet reléforbindelse venter på den direkte WebRTC-forbindelsen før den brukes i stedet. Øk verdien for å gi en treg direkteforbindelse mer tid; senk den for å gå raskere over til reléet på nettverk der direkte forbindelse ikke er mulig. La stå tom for standardverdien på 2.5 sekunder."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+25
-25
@@ -7,11 +7,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Password", "Wachtwoord"),
|
||||
("Ready", "Gereed"),
|
||||
("Established", "Opgezet"),
|
||||
("connecting_status", "Verbinding maken met het RustDesk-netwerk..."),
|
||||
("connecting_status", "Verbinding maken met het RustDesk-netwerk…"),
|
||||
("Enable service", "Service inschakelen"),
|
||||
("Start service", "Service starten"),
|
||||
("Service is running", "De service loopt."),
|
||||
("Service is not running", "De service loopt niet"),
|
||||
("Service is running", "Service loopt."),
|
||||
("Service is not running", "Service loopt niet"),
|
||||
("not_ready_status", "Niet verbonden met de server, controleer de netwerkverbinding"),
|
||||
("Control Remote Desktop", "Extern Bureaublad beheren"),
|
||||
("Transfer file", "Bestand overzetten"),
|
||||
@@ -76,12 +76,12 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Connection Error", "Fout bij verbinding"),
|
||||
("Error", "Fout"),
|
||||
("Reset by the peer", "Door de peer gereset"),
|
||||
("Connecting...", "Verbinding maken..."),
|
||||
("Connecting...", "Verbinding maken…"),
|
||||
("Connection in progress. Please wait.", "Verbinding wordt gemaakt. Even geduld."),
|
||||
("Please try 1 minute later", "Probeer opnieuw over 1 minuut"),
|
||||
("Login Error", "Loginfout"),
|
||||
("Successful", "Geslaagd"),
|
||||
("Connected, waiting for image...", "Verbonden, wachten op beeld..."),
|
||||
("Connected, waiting for image...", "Verbonden, wachten op beeld…"),
|
||||
("Name", "Naam"),
|
||||
("Type", "Type"),
|
||||
("Modified", "Gewijzigd"),
|
||||
@@ -94,7 +94,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Remote", "Op afstand"),
|
||||
("Remote Computer", "Externe computer"),
|
||||
("Local Computer", "Lokale computer"),
|
||||
("Confirm Delete", "Verwijderen bevestigen"),
|
||||
("Confirm Delete", "Verwijdering bevestigen"),
|
||||
("Delete", "Verwijderen"),
|
||||
("Properties", "Eigenschappen"),
|
||||
("Multi Select", "Meervoudige selectie"),
|
||||
@@ -127,7 +127,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Optimize reaction time", "Responstijd optimaliseren"),
|
||||
("Custom", "Aangepast"),
|
||||
("Show remote cursor", "Cursor van extern bureaublad weergeven"),
|
||||
("Show quality monitor", "Kwaliteitsmonitor tonen"),
|
||||
("Show quality monitor", "Kwaliteitsmonitor weergeven"),
|
||||
("Disable clipboard", "Klembord uitschakelen"),
|
||||
("Lock after session end", "Vergrendelen na einde sessie"),
|
||||
("Insert Ctrl + Alt + Del", "Ctrl + Alt + Del invoeren"),
|
||||
@@ -150,7 +150,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Configure", "Configureren"),
|
||||
("config_acc", "Om uw apparaat op afstand te kunnen bedienen, moet u RustDesk toestemming geven voor Toegankelijkheid."),
|
||||
("config_screen", "Om uw apparaat op afstand te kunnen bedienen, moet u RustDesk toestemming geven voor Schermopname."),
|
||||
("Installing ...", "Installeren ..."),
|
||||
("Installing ...", "Installeren…"),
|
||||
("Install", "Installeren"),
|
||||
("Installation", "Installatie"),
|
||||
("Installation Path", "Locatie"),
|
||||
@@ -159,10 +159,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("agreement_tip", "Het starten van de installatie betekent het accepteren van de licentieovereenkomst."),
|
||||
("Accept and Install", "Accepteren en installeren"),
|
||||
("End-user license agreement", "Eindgebruikerslicentieovereenkomst"),
|
||||
("Generating ...", "Genereren ..."),
|
||||
("Generating ...", "Genereren…"),
|
||||
("Your installation is lower version.", "Uw installatie is een lagere versie."),
|
||||
("not_close_tcp_tip", "Sluit dit venster niet zolang u de tunnel gebruikt"),
|
||||
("Listening ...", "Luisteren ..."),
|
||||
("Listening ...", "Luisteren…"),
|
||||
("Remote Host", "Externe host"),
|
||||
("Remote Port", "Externe poort"),
|
||||
("Action", "Actie"),
|
||||
@@ -185,7 +185,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Relayed and unencrypted connection", "Doorgeschakelde en niet-versleutelde verbinding"),
|
||||
("Enter Remote ID", "Extern ID invoeren"),
|
||||
("Enter your password", "Wachtwoord invoeren"),
|
||||
("Logging in...", "Aanmelden..."),
|
||||
("Logging in...", "Aanmelden…"),
|
||||
("Enable RDP session sharing", "Delen van RDP-sessie inschakelen"),
|
||||
("Auto Login", "Automatisch aanmelden"),
|
||||
("Enable direct IP access", "Directe IP-toegang inschakelen"),
|
||||
@@ -368,11 +368,11 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Deny LAN discovery", "LAN-detectie weigeren"),
|
||||
("Write a message", "Schrijf een bericht"),
|
||||
("Prompt", "Melding"),
|
||||
("Please wait for confirmation of UAC...", "Wacht op UAC-bevestiging..."),
|
||||
("Please wait for confirmation of UAC...", "Wacht op UAC-bevestiging…"),
|
||||
("elevated_foreground_window_tip", "Het momenteel geopende venster van de op afstand bediende computer vereist hogere rechten. Daarom is het momenteel niet mogelijk de muis en het toetsenbord te gebruiken. Vraag de gebruiker wiens computer u op afstand bedient om het venster te minimaliseren of de rechten te verhogen. Om dit probleem in de toekomst te voorkomen, wordt aanbevolen de software te installeren op de op afstand bediende computer."),
|
||||
("Disconnected", "Afgesloten"),
|
||||
("Other", "Andere"),
|
||||
("Confirm before closing multiple tabs", "Bevestig voordat u meerdere tabbladen sluit"),
|
||||
("Confirm before closing multiple tabs", "Bevestiging geven bij sluiten van meerdere tabbladen"),
|
||||
("Keyboard Settings", "Toetsenbordinstellingen"),
|
||||
("Full Access", "Volledige toegang"),
|
||||
("Screen Share", "Scherm delen"),
|
||||
@@ -381,7 +381,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("xdp-portal-unavailable", "Wayland schermopname is mislukt. De XDG Desktop Portal kan gecrashed zijn of is onbeschikbaar. Probeer het opnieuw te starten met `systemctl --user restart xdg-desktop-portal`."),
|
||||
("JumpLink", "JumpLink"),
|
||||
("Please Select the screen to be shared(Operate on the peer side).", "Selecteer het scherm dat moet worden gedeeld (Bediening aan de kant van de peer)."),
|
||||
("Show RustDesk", "Toon RustDesk"),
|
||||
("Show RustDesk", "RustDesk weergeven"),
|
||||
("This PC", "Deze PC"),
|
||||
("or", "of"),
|
||||
("Elevate", "Verhogen"),
|
||||
@@ -389,7 +389,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Accept sessions via password", "Sessies accepteren via wachtwoord"),
|
||||
("Accept sessions via click", "Sessies accepteren via klik"),
|
||||
("Accept sessions via both", "Accepteer sessies via klik of wachtwoord"),
|
||||
("Please wait for the remote side to accept your session request...", "Wacht tot de andere kant uw sessieverzoek accepteert..."),
|
||||
("Please wait for the remote side to accept your session request...", "Wacht tot de andere kant uw sessieverzoek accepteert…"),
|
||||
("One-time Password", "Eenmalig wachtwoord"),
|
||||
("Use one-time password", "Eenmalig wachtwoord gebruiken"),
|
||||
("One-time password length", "Lengte eenmalig wachtwoord"),
|
||||
@@ -428,7 +428,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Medium", "Middelmatig"),
|
||||
("Strong", "Sterk"),
|
||||
("Switch Sides", "Van kant wisselen"),
|
||||
("Please confirm if you want to share your desktop?", "Bevestig dat u uw bureaublad wilt delen?"),
|
||||
("Please confirm if you want to share your desktop?", "Weet u zeker dat u uw bureaublad wilt delen?"),
|
||||
("Display", "Weergave"),
|
||||
("Default View Style", "Standaard Weergavestijl"),
|
||||
("Default Scroll Style", "Standaard Scrollstijl"),
|
||||
@@ -649,13 +649,13 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("use-the-default-printer-tip", "Standaard printer gebruiken"),
|
||||
("use-the-selected-printer-tip", "Geselecteerde printer gebruiken"),
|
||||
("auto-print-tip", "Automatisch afdrukken op de geselecteerde printer."),
|
||||
("print-incoming-job-confirm-tip", "Er werd een afdruktaak ontvangen van een extern apparaat. Moet ik deze lokaal afdrukken?"),
|
||||
("remote-printing-disallowed-tile-tip", "Afdruk op afstand is verboden"),
|
||||
("print-incoming-job-confirm-tip", "Er werd een afdruktaak ontvangen van een extern apparaat. Moet deze lokaal worden afgedrukt?"),
|
||||
("remote-printing-disallowed-tile-tip", "Afdruk op afstand is niet toegestaan"),
|
||||
("remote-printing-disallowed-text-tip", "Machtigingsinstellingen aan beheerde zijde verhinderen afdrukken op afstand."),
|
||||
("save-settings-tip", "Instellingen opslaan"),
|
||||
("dont-show-again-tip", "Dit bericht wordt niet meer weergegeven"),
|
||||
("Take screenshot", "Schermopname maken"),
|
||||
("Taking screenshot", "Schermopname maken..."),
|
||||
("Taking screenshot", "Schermopname maken…"),
|
||||
("screenshot-merged-screen-not-supported-tip", "Schermopnames van meerdere schermen samenvoegen wordt momenteel niet ondersteund. Schakel over naar een enkel scherm en herhaal de actie."),
|
||||
("screenshot-action-tip", "Kies wat je met de gemaakte schermopname wilt doen."),
|
||||
("Save as", "Opslaan als"),
|
||||
@@ -693,7 +693,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Failed to check if the user is an administrator.", "Fout bij het controleren of de gebruiker een beheerder is."),
|
||||
("Supported only in the installed version.", "Alleen ondersteund in de geïnstalleerde versie."),
|
||||
("elevation_username_tip", "Voer je gebruikersnaam of domeinnaam in"),
|
||||
("Preparing for installation ...", "Installatie voorbereiden ..."),
|
||||
("Preparing for installation ...", "Installatie voorbereiden…"),
|
||||
("Show my cursor", "Mijn cursor weergeven"),
|
||||
("Scale custom", "Aangepaste schaal"),
|
||||
("Custom scale slider", "Aangepaste schuifregelaar voor schaal"),
|
||||
@@ -713,8 +713,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("disable-udp-tip", "Controleert of alleen TCP moet worden gebruikt. Als deze optie is ingeschakeld, gebruikt RustDesk niet langer UDP 21116, maar TCP 21116."),
|
||||
("server-oss-not-support-tip", "Opmerking: Deze functie is niet beschikbaar in de open-sourceversie van de RustDesk-server."),
|
||||
("input note here", "voeg hier een opmerking toe"),
|
||||
("note-at-conn-end-tip", "Vraag om een opmerking aan het einde van de verbinding"),
|
||||
("Show terminal extra keys", "Toon extra toetsen voor terminal"),
|
||||
("note-at-conn-end-tip", "Om een opmerking vragen aan het einde van de verbinding"),
|
||||
("Show terminal extra keys", "Extra toetsen voor terminal weergeven"),
|
||||
("Relative mouse mode", "Relatieve muismodus"),
|
||||
("rel-mouse-not-supported-peer-tip", "De relatieve muismodus wordt niet ondersteund door het externe apparaat."),
|
||||
("rel-mouse-not-ready-tip", "De relatieve muismodus was nog niet klaar, probeer het later opnieuw."),
|
||||
@@ -763,8 +763,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Lock canvas", "Canvas vergrendelen"),
|
||||
("Sync clipboard between sessions", "Klembord synchroniseren tussen sessies"),
|
||||
("sync-clipboard-between-sessions-tip", "Tekst of afbeeldingen die in één externe sessie worden gekopieerd, worden ook naar het klembord van uw andere verbonden sessies gestuurd."),
|
||||
("terminal-clipboard-write-tip", ""),
|
||||
("Allow terminal apps to copy to clipboard", ""),
|
||||
("terminal-clipboard-write-tip", "Een app in de terminal wil tekst naar het klembord van dit apparaat kopiëren. Indien verleend, is deze toestemming van toepassing op terminal-apps in alle verbindingen totdat u deze uitschakelt in Instellingen. Handmatig kopiëren en plakken wordt niet beïnvloed."),
|
||||
("Allow terminal apps to copy to clipboard", "Terminal-apps toestaan om naar klembord te kopiëren"),
|
||||
("Enable", "Inschakelen"),
|
||||
("Reuse one connection for port forwarding", "Eén verbinding hergebruiken voor poortdoorschakeling"),
|
||||
("port-forward-mux-tip", "Alle verbindingen van een poortdoorschakeling via één enkele verbinding met de andere computer laten lopen, in plaats van voor elke verbinding opnieuw verbinding te maken en in te loggen."),
|
||||
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk kon een GStreamer-component die nodig is voor schermopname niet laden ({})"),
|
||||
("Relay fallback delay in seconds", "Vertraging voordat relay wordt gebruikt in seconden"),
|
||||
("relay-fallback-delay-tip", "Hoe lang een al tot stand gekomen relayverbinding wacht op de directe WebRTC-verbinding voordat deze in plaats daarvan wordt gebruikt. Verhoog de waarde om een trage directe verbinding meer tijd te geven; verlaag deze om op netwerken waar een directe verbinding niet mogelijk is sneller op de relay terug te vallen. Laat leeg voor de standaardwaarde van 2.5 seconden."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "Om een spraakgesprek te starten, schakel je \"Audio-opname\" in op de pagina \"Scherm delen\".")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Om een spraakgesprek te starten, schakel je \"Audio-opname\" in op de pagina \"Scherm delen\".")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+3
-3
@@ -763,8 +763,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("Lock canvas", "Zablokuj ekran"),
|
||||
("Sync clipboard between sessions", "Synchronizuj schowek między sesjami"),
|
||||
("sync-clipboard-between-sessions-tip", "Tekst lub obrazy skopiowane w jednej sesji zdalnej są wysyłane także do schowka pozostałych połączonych sesji."),
|
||||
("terminal-clipboard-write-tip", ""),
|
||||
("Allow terminal apps to copy to clipboard", ""),
|
||||
("terminal-clipboard-write-tip", "Aplikacja w terminalu chce skopiować tekst do schowka tego urządzenia. Jeśli wyrazisz na to zgodę, uprawnienie to będzie dotyczyć aplikacji terminalowych we wszystkich połączeniach, dopóki nie wyłączysz go w Ustawieniach. Ręczne kopiowanie i wklejanie pozostanie bez zmian."),
|
||||
("Allow terminal apps to copy to clipboard", "Zezwól aplikacjom terminalowym na kopiowanie do schowka"),
|
||||
("Enable", "Włącz"),
|
||||
("Reuse one connection for port forwarding", "Użyj ponownie jednego połączenia do przekierowania portów"),
|
||||
("port-forward-mux-tip", "Przekazuj wszystkie połączenia jednego przekierowania portów przez jedno połączenie ze zdalnym komputerem, zamiast łączyć się i logować od nowa dla każdego z nich."),
|
||||
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk nie mógł załadować składnika GStreamer wymaganego do przechwytywania ekranu ({})"),
|
||||
("Relay fallback delay in seconds", "Opóźnienie przed przejściem na przekaźnik w sekundach"),
|
||||
("relay-fallback-delay-tip", "Jak długo nawiązane już połączenie przez przekaźnik czeka na bezpośrednie połączenie WebRTC, zanim zostanie użyte zamiast niego. Zwiększ, aby dać wolnemu połączeniu bezpośredniemu więcej czasu; zmniejsz, aby w sieciach, w których połączenie bezpośrednie jest niemożliwe, szybciej przechodzić na przekaźnik. Pozostaw puste, aby użyć wartości domyślnej 2.5 sekundy."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Aby rozpocząć połączenie głosowe, włącz opcję \"Przechwytywanie dźwięku\" na stronie \"Udostępnianie ekranu\".")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "O RustDesk não conseguiu carregar um componente do GStreamer necessário para a captura de tela ({})."),
|
||||
("Relay fallback delay in seconds", "Atraso antes de recorrer ao retransmissor em segundos"),
|
||||
("relay-fallback-delay-tip", "Tempo que a conexão de retransmissão aguarda pela conexão direta WebRTC. Aumente para dar mais tempo a conexões lentas; diminua para usar o retransmissor mais cedo. Deixe vazio para usar o padrão de 2,5 segundos."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "Para iniciar uma chamada de voz, ative \"Captura de áudio\" na página \"Compartilhamento de tela\".")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Para iniciar uma chamada de voz, ative \"Captura de áudio\" na página \"Compartilhar Tela\".")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "O RustDesk não conseguiu carregar um componente do GStreamer necessário para capturar o ecrã ({})"),
|
||||
("Relay fallback delay in seconds", "Atraso antes de recorrer ao retransmissor em segundos"),
|
||||
("relay-fallback-delay-tip", "Quanto tempo uma ligação de retransmissão já estabelecida aguarda pela ligação direta WebRTC antes de ser usada em vez dela. Aumente para dar mais tempo a uma ligação direta lenta; diminua para recorrer mais cedo ao retransmissor em redes onde não é possível uma ligação direta. Deixe vazio para o valor predefinido de 2.5 segundos."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Para iniciar uma chamada de voz, ative \"Captura de Áudio\" na página \"Partilhar ecrã\".")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk nu a putut încărca o componentă GStreamer necesară pentru capturarea ecranului ({})"),
|
||||
("Relay fallback delay in seconds", "Întârziere înainte de trecerea la releu în secunde"),
|
||||
("relay-fallback-delay-tip", "Cât timp așteaptă o conexiune prin releu deja stabilită conexiunea directă WebRTC înainte de a fi folosită în locul ei. Măriți valoarea pentru a acorda mai mult timp unei conexiuni directe lente; micșorați-o pentru a trece mai repede la releu în rețelele în care o conexiune directă nu este posibilă. Lăsați gol pentru valoarea implicită de 2.5 secunde."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk не удалось загрузить компонент GStreamer, необходимый для захвата экрана ({})"),
|
||||
("Relay fallback delay in seconds", "Задержка перед переходом на ретранслятор в секундах"),
|
||||
("relay-fallback-delay-tip", "Сколько времени уже установленное соединение через ретранслятор ждёт прямое соединение WebRTC, прежде чем будет использовано вместо него. Увеличьте, чтобы дать медленному прямому соединению больше времени; уменьшите, чтобы быстрее переходить на ретранслятор в сетях, где прямое соединение невозможно. Оставьте пустым для значения по умолчанию 2.5 секунды."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "Чтобы начать голосовой вызов, включите \"Захват аудио\" на странице \"Демонстрация экрана\" настроек.")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Чтобы начать голосовой вызов, включите \"Захват аудио\" на странице \"Демонстрация экрана\".")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk no at pòdidu carrigare unu cumponente de GStreamer netzessàriu pro registrare sa schermada ({})"),
|
||||
("Relay fallback delay in seconds", "Tardu prima de impreare su relè in segundos"),
|
||||
("relay-fallback-delay-tip", "Cantu tempus una connessione de relè giai istabilida abetat sa connessione direta WebRTC prima de èssere impreada in su postu suo. Aumenta pro dare prus tempus a una connessione direta lenta; diminuì pro colare prima a su relè in sas retes in ue non si podet fàghere una connessione direta. Lassa bòidu pro su valore predefinidu de 2.5 segundos."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "Pro aviare una mutida de boghe, ativa in sa pàgina \"Cumpartzidura de ischermu\" s’elementu \"Catura de s’àudio\".")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Pro aviare una mutida de boghe, ativa in sa pàgina \"Cumpartzi ischermu\" s’elementu \"Catura de s’àudio\".")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk nedokázal načítať komponent GStreamera potrebný na zachytenie obrazovky ({})"),
|
||||
("Relay fallback delay in seconds", "Oneskorenie pred prepnutím na prenos v sekundách"),
|
||||
("relay-fallback-delay-tip", "Ako dlho už nadviazané spojenie cez prenos čaká na priame spojenie WebRTC, kým sa použije namiesto neho. Zvýšte, aby pomalé priame spojenie malo viac času; znížte, aby sa v sieťach, kde priame spojenie nie je možné, skôr prešlo na prenos. Nechajte prázdne pre predvolenú hodnotu 2.5 sekundy."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk ni mogel naložiti komponente GStreamer, potrebne za zajem zaslona ({})"),
|
||||
("Relay fallback delay in seconds", "Zakasnitev pred preklopom na posrednika v sekundah"),
|
||||
("relay-fallback-delay-tip", "Kako dolgo že vzpostavljena posredniška povezava čaka na neposredno povezavo WebRTC, preden se uporabi namesto nje. Povečajte, da počasni neposredni povezavi date več časa; zmanjšajte, da v omrežjih, kjer neposredna povezava ni mogoča, hitreje preklopite na posrednika. Pustite prazno za privzeto vrednost 2.5 sekunde."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk nuk mundi të ngarkojë një komponent të GStreamer të nevojshëm për regjistrimin e ekranit ({})"),
|
||||
("Relay fallback delay in seconds", "Vonesa para kalimit te releja në sekonda"),
|
||||
("relay-fallback-delay-tip", "Sa gjatë pret një lidhje releje tashmë e vendosur lidhjen e drejtpërdrejtë WebRTC përpara se të përdoret në vend të saj. Rriteni për t'i dhënë më shumë kohë një lidhjeje të drejtpërdrejtë të ngadaltë; uleni për të kaluar më shpejt te releja në rrjete ku lidhja e drejtpërdrejtë nuk është e mundur. Lëreni bosh për vlerën e parazgjedhur prej 2.5 sekondash."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk nije mogao da učita GStreamer komponentu potrebnu za snimanje ekrana ({})"),
|
||||
("Relay fallback delay in seconds", "Кашњење пре преласка на релеј у секундама"),
|
||||
("relay-fallback-delay-tip", "Колико дуго већ успостављена релејна веза чека на директну WebRTC везу пре него што се употреби уместо ње. Повећајте да бисте спорој директној вези дали више времена; смањите да бисте на мрежама где директна веза није могућа брже прешли на релеј. Оставите празно за подразумевану вредност од 2.5 секунде."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk kunde inte läsa in en GStreamer-komponent som krävs för skärminspelning ({})"),
|
||||
("Relay fallback delay in seconds", "Fördröjning innan relä används i sekunder"),
|
||||
("relay-fallback-delay-tip", "Hur länge en redan upprättad reläanslutning väntar på den direkta WebRTC-anslutningen innan den används i stället. Öka värdet för att ge en långsam direktanslutning mer tid; sänk det för att snabbare falla tillbaka på reläet i nätverk där direktanslutning inte är möjlig. Lämna tomt för standardvärdet 2.5 sekunder."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "திரைப் பதிவுக்குத் தேவையான GStreamer கூறை RustDesk ஏற்ற முடியவில்லை ({})"),
|
||||
("Relay fallback delay in seconds", "ரிலேக்கு மாறுவதற்கான தாமதம் வினாடிகளில்"),
|
||||
("relay-fallback-delay-tip", "ஏற்கனவே நிறுவப்பட்ட ரிலே இணைப்பு நேரடி WebRTC இணைப்புக்காக எவ்வளவு நேரம் காத்திருக்கிறது, அதன் பிறகு அதற்குப் பதிலாகப் பயன்படுத்தப்படுகிறது. மெதுவான நேரடி இணைப்புக்கு அதிக நேரம் வழங்க அதிகரிக்கவும்; நேரடி இணைப்பு சாத்தியமில்லாத பிணையங்களில் விரைவாக ரிலேக்கு மாற குறைக்கவும். இயல்புநிலை 2.5 வினாடிகளுக்கு காலியாக விடவும்."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", ""),
|
||||
("Relay fallback delay in seconds", ""),
|
||||
("relay-fallback-delay-tip", ""),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk ไม่สามารถโหลดส่วนประกอบ GStreamer ที่จำเป็นสำหรับการบันทึกหน้าจอได้ ({})"),
|
||||
("Relay fallback delay in seconds", "เวลารอก่อนเปลี่ยนไปใช้รีเลย์ (วินาที)"),
|
||||
("relay-fallback-delay-tip", "การเชื่อมต่อผ่านรีเลย์ที่สร้างไว้แล้วจะรอการเชื่อมต่อ WebRTC โดยตรงนานเท่าใดก่อนที่จะถูกใช้แทน เพิ่มค่าเพื่อให้การเชื่อมต่อโดยตรงที่ช้ามีเวลามากขึ้น ลดค่าเพื่อเปลี่ยนไปใช้รีเลย์เร็วขึ้นในเครือข่ายที่ไม่สามารถเชื่อมต่อโดยตรงได้ เว้นว่างไว้เพื่อใช้ค่าเริ่มต้น 2.5 วินาที"),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk ekran yakalama için gereken GStreamer bileşenini yükleyemedi ({})"),
|
||||
("Relay fallback delay in seconds", "Aktarıcıya geçiş gecikmesi (saniye)"),
|
||||
("relay-fallback-delay-tip", "Zaten kurulmuş bir aktarıcı bağlantısının, onun yerine kullanılmadan önce doğrudan WebRTC bağlantısını ne kadar beklediğidir. Yavaş bir doğrudan bağlantıya daha fazla süre tanımak için artırın; doğrudan bağlantının kurulamadığı ağlarda aktarıcıya daha erken geçmek için azaltın. Varsayılan 2.5 saniye için boş bırakın."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "Sesli arama başlatmak için \"Ekran paylaşımı\" sayfasındaki \"Ses yakalama\" seçeneğini açın.")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Sesli arama başlatmak için \"Ekranı Paylaş\" sayfasındaki \"Ses yakalama\" seçeneğini açın.")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk 無法載入螢幕擷取所需的 GStreamer 元件 ({})"),
|
||||
("Relay fallback delay in seconds", "回退到中繼前的等待時間(秒)"),
|
||||
("relay-fallback-delay-tip", "已經建立的中繼連線會等待直連的 WebRTC 多久,超過這個時間就改用中繼。調大可以讓較慢的直連有更多機會勝出;調小則在無法直連的網路上更快回退到中繼。留空表示使用預設值 2.5 秒。"),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "若要開始語音通話,請在「僅分享螢幕畫面」頁面啟用「音訊錄製」。")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "若要開始語音通話,請在「螢幕分享」頁面啟用「音訊錄製」。")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk не вдалося завантажити компонент GStreamer, потрібний для захоплення екрана ({})"),
|
||||
("Relay fallback delay in seconds", "Затримка перед переходом на ретранслятор у секундах"),
|
||||
("relay-fallback-delay-tip", "Скільки часу вже встановлене з'єднання через ретранслятор чекає на пряме з'єднання WebRTC, перш ніж буде використане замість нього. Збільште, щоб дати повільному прямому з'єднанню більше часу; зменште, щоб швидше переходити на ретранслятор у мережах, де пряме з'єднання неможливе. Залиште порожнім для типового значення 2.5 секунди."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "Щоб розпочати голосовий виклик, увімкніть «Захоплення аудіо» на сторінці «Демонстрація екрана»."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "Щоб розпочати голосовий виклик, увімкніть «Захоплення аудіо» на сторінці «Поділитися екраном»."),
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
+1
-1
@@ -780,7 +780,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk اسکرین ریکارڈنگ کے لیے درکار GStreamer جزو لوڈ نہیں کر سکا ({})"),
|
||||
("Relay fallback delay in seconds", "ریلے پر واپس جانے میں تاخیر سیکنڈ میں"),
|
||||
("relay-fallback-delay-tip", "پہلے سے قائم ریلے کنکشن براہ راست WebRTC کنکشن کا کتنی دیر انتظار کرتا ہے، اس کے بعد اس کی جگہ استعمال ہوتا ہے۔ سست براہ راست کنکشن کو مزید وقت دینے کے لیے بڑھائیں؛ ان نیٹ ورکس پر جہاں براہ راست کنکشن ممکن نہیں، جلد ریلے پر جانے کے لیے کم کریں۔ پہلے سے طے شدہ 2.5 سیکنڈ کے لیے خالی چھوڑ دیں۔"),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -780,6 +780,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
|
||||
("RustDesk could not load a GStreamer component needed for screen capture ({})", "RustDesk không thể tải một thành phần GStreamer cần cho việc ghi màn hình ({})"),
|
||||
("Relay fallback delay in seconds", "Độ trễ trước khi chuyển sang trung chuyển (giây)"),
|
||||
("relay-fallback-delay-tip", "Kết nối trung chuyển đã thiết lập sẽ chờ kết nối WebRTC trực tiếp trong bao lâu trước khi được dùng thay thế. Tăng giá trị để cho kết nối trực tiếp chậm thêm thời gian; giảm để chuyển sang trung chuyển sớm hơn trên các mạng không thể kết nối trực tiếp. Để trống để dùng giá trị mặc định 2.5 giây."),
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Screen share\" page.", "")
|
||||
("To start a voice call, enable \"Audio capture\" on the \"Share screen\" page.", "")
|
||||
].iter().cloned().collect();
|
||||
}
|
||||
|
||||
@@ -767,6 +767,10 @@ pub fn is_locked() -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_logon_screen() -> bool {
|
||||
is_prelogin() || is_locked()
|
||||
}
|
||||
|
||||
pub fn is_root() -> bool {
|
||||
crate::username() == "root"
|
||||
}
|
||||
|
||||
@@ -604,14 +604,16 @@ extern "C"
|
||||
return rdp_or_console;
|
||||
}
|
||||
|
||||
BOOL is_session_locked(DWORD session_id)
|
||||
// WTSInfoExLevel1.SessionFlags, or WTS_SESSIONSTATE_UNKNOWN when it cannot be read.
|
||||
DWORD get_session_flags(DWORD session_id)
|
||||
{
|
||||
DWORD flags = WTS_SESSIONSTATE_UNKNOWN;
|
||||
// WTS_CURRENT_SESSION, which would query the caller's session instead.
|
||||
if (session_id == 0xFFFFFFFF) {
|
||||
return FALSE;
|
||||
return flags;
|
||||
}
|
||||
PWTSINFOEXW pInfo = NULL;
|
||||
DWORD bytes = 0;
|
||||
BOOL locked = FALSE;
|
||||
if (WTSQuerySessionInformationW(
|
||||
WTS_CURRENT_SERVER_HANDLE,
|
||||
session_id,
|
||||
@@ -619,13 +621,13 @@ extern "C"
|
||||
(LPWSTR *)&pInfo,
|
||||
&bytes)) {
|
||||
if (pInfo && pInfo->Level == 1) {
|
||||
locked = (pInfo->Data.WTSInfoExLevel1.SessionFlags == WTS_SESSIONSTATE_LOCK);
|
||||
flags = (DWORD)pInfo->Data.WTSInfoExLevel1.SessionFlags;
|
||||
}
|
||||
if (pInfo) {
|
||||
WTSFreeMemory(pInfo);
|
||||
}
|
||||
}
|
||||
return locked;
|
||||
return flags;
|
||||
}
|
||||
|
||||
uint32_t get_active_user(PWSTR bufin, uint32_t nin, BOOL rdp)
|
||||
|
||||
+77
-6
@@ -565,7 +565,6 @@ const SERVICE_TYPE: ServiceType = ServiceType::OWN_PROCESS;
|
||||
|
||||
extern "C" {
|
||||
fn get_current_session(rdp: BOOL) -> DWORD;
|
||||
fn is_session_locked(session_id: DWORD) -> BOOL;
|
||||
fn LaunchProcessWin(
|
||||
cmd: *const u16,
|
||||
session_id: DWORD,
|
||||
@@ -1269,7 +1268,7 @@ pub fn is_locked() -> bool {
|
||||
let Some(session_id) = get_current_process_session_id() else {
|
||||
return false;
|
||||
};
|
||||
unsafe { is_session_locked(session_id) == TRUE }
|
||||
is_session_locked_flag(session_id) == Some(true)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
@@ -1283,6 +1282,47 @@ pub fn is_logon_ui() -> ResultType<bool> {
|
||||
.any(|pid| get_session_id_of_process(pid) == Some(current_sid)))
|
||||
}
|
||||
|
||||
// Auto-login types the OS password on this, so a state that cannot be read counts as unlocked.
|
||||
// `is_prelogin()` reads a failed query as no user signed in, and `is_logon_ui()` is left out
|
||||
// because a LogonUI.exe can outlive the unlock.
|
||||
pub fn is_logon_screen() -> bool {
|
||||
let Some(session_id) = get_current_process_session_id() else {
|
||||
return false;
|
||||
};
|
||||
is_session_prelogin(session_id) == Some(true)
|
||||
|| is_session_locked_flag(session_id) == Some(true)
|
||||
}
|
||||
|
||||
fn is_session_prelogin(session_id: u32) -> Option<bool> {
|
||||
extern "C" {
|
||||
fn get_session_user_info(path: *mut u16, n: u32, session_id: u32) -> u32;
|
||||
}
|
||||
let mut buff = [0u16; 256];
|
||||
// The bytes copied include the terminating null, so 0 means the query failed.
|
||||
let n = unsafe { get_session_user_info(buff.as_mut_ptr(), buff.len() as _, session_id) };
|
||||
if n == 0 {
|
||||
return None;
|
||||
}
|
||||
let username = String::from_utf16_lossy(&buff);
|
||||
let username = username.trim_end_matches('\0');
|
||||
Some(username.is_empty() || username == "SYSTEM")
|
||||
}
|
||||
|
||||
// Windows 7 and Server 2008 R2 report LOCK and UNLOCK the other way round (see WTSINFOEX_LEVEL1).
|
||||
fn is_session_locked_flag(session_id: u32) -> Option<bool> {
|
||||
extern "C" {
|
||||
fn get_session_flags(session_id: DWORD) -> DWORD;
|
||||
}
|
||||
const WTS_SESSIONSTATE_LOCK: DWORD = 0;
|
||||
const WTS_SESSIONSTATE_UNLOCK: DWORD = 1;
|
||||
let reversed = !base::platform::windows::is_windows_version_or_greater(6, 2, 0, 0, 0);
|
||||
match unsafe { get_session_flags(session_id) } {
|
||||
WTS_SESSIONSTATE_LOCK => Some(!reversed),
|
||||
WTS_SESSIONSTATE_UNLOCK => Some(reversed),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_root() -> bool {
|
||||
// https://stackoverflow.com/questions/4023586/correct-way-to-find-out-if-a-service-is-running-as-the-system-user
|
||||
unsafe { is_local_system() == TRUE }
|
||||
@@ -1354,6 +1394,10 @@ pub fn get_install_options() -> String {
|
||||
}
|
||||
|
||||
pub fn get_silent_install_options(printer_override: Option<bool>) -> &'static str {
|
||||
if !is_win_10_or_greater() {
|
||||
return "desktopicon startmenu";
|
||||
}
|
||||
|
||||
let install_printer = match printer_override {
|
||||
Some(override_value) => override_value,
|
||||
None => {
|
||||
@@ -1361,9 +1405,13 @@ pub fn get_silent_install_options(printer_override: Option<bool>) -> &'static st
|
||||
let subkey = format!(".{}", app_name.to_lowercase());
|
||||
let printer = get_reg_of_hkcr(&subkey, REG_NAME_INSTALL_PRINTER);
|
||||
printer.as_deref() == Some("1")
|
||||
&& remote_printer::is_rd_printer_installed(&app_name).unwrap_or_else(|err| {
|
||||
log::warn!("Failed to check printer installation status: {err}; skipping printer installation");
|
||||
false
|
||||
})
|
||||
}
|
||||
};
|
||||
if install_printer && is_win_10_or_greater() {
|
||||
if install_printer {
|
||||
"desktopicon startmenu printer"
|
||||
} else {
|
||||
"desktopicon startmenu"
|
||||
@@ -3911,8 +3959,22 @@ pub fn update_to(file: &str) -> ResultType<()> {
|
||||
// We need also to handle the command line parsing to find the tray processes.
|
||||
pub fn update_me_msi(msi: &str, quiet: bool) -> ResultType<()> {
|
||||
let quiet_args = if quiet { " /qn LAUNCH_TRAY_APP=N" } else { "" };
|
||||
let cmds =
|
||||
format!("chcp 65001 && msiexec /i \"{msi}\"{quiet_args} REBOOT=ReallySuppress /norestart");
|
||||
let app_name = crate::get_app_name();
|
||||
let subkey = format!(".{}", app_name.to_lowercase());
|
||||
let printer_installed = get_reg_of_hkcr(&subkey, REG_NAME_INSTALL_PRINTER).as_deref()
|
||||
!= Some("0")
|
||||
&& remote_printer::is_rd_printer_installed(&app_name).unwrap_or_else(|err| {
|
||||
log::warn!(
|
||||
"Failed to check printer installation status: {err}; skipping printer installation"
|
||||
);
|
||||
false
|
||||
});
|
||||
let printer_args = if printer_installed {
|
||||
""
|
||||
} else {
|
||||
" INSTALLPRINTER=0"
|
||||
};
|
||||
let cmds = format!("chcp 65001 && msiexec /i \"{msi}\"{quiet_args}{printer_args} REBOOT=ReallySuppress /norestart");
|
||||
run_cmds(cmds, false, "update-msi")?;
|
||||
Ok(())
|
||||
}
|
||||
@@ -4846,7 +4908,16 @@ mod tests {
|
||||
#[test]
|
||||
fn install_app_names_enforce_ascii_command_safety() {
|
||||
assert!(validate_install_app_name("RustDesk-Admin1").is_ok());
|
||||
for app_name in ["", "RustDesk_Admin", "RustDesk&whoami", "RustDesk应用"] {
|
||||
for app_name in [
|
||||
"",
|
||||
"RustDesk_Admin",
|
||||
"RustDesk&whoami",
|
||||
"RustDesk应用",
|
||||
"RustDesk앱",
|
||||
"RustDeskBüro",
|
||||
"RustDeskFrançais",
|
||||
"RustDeskアプリ",
|
||||
] {
|
||||
assert!(
|
||||
validate_install_app_name(app_name).is_err(),
|
||||
"unsafe application name was accepted: {app_name}"
|
||||
|
||||
@@ -75,6 +75,11 @@ pub trait PrivacyMode: Sync + Send {
|
||||
Ok(false)
|
||||
}
|
||||
|
||||
/// `INVALID_PRIVACY_MODE_CONN_ID` deliberately bypasses the ownership check, meaning
|
||||
/// "turn it off whoever owns it": shutdown (`ipc::Data::Close`), `reset_all`, and
|
||||
/// `TurnOnGuard`, which undoes a half-finished turn-on however far it got. A caller
|
||||
/// acting for one connection must pass that connection's own id, or it can turn off
|
||||
/// privacy mode belonging to another.
|
||||
#[inline]
|
||||
fn check_off_conn_id(&self, conn_id: i32) -> ResultType<()> {
|
||||
let pre_conn_id = self.pre_conn_id();
|
||||
@@ -289,6 +294,29 @@ fn turn_on_privacy_sync(impl_key: &str, conn_id: i32) -> Option<ResultType<bool>
|
||||
Some(privacy_mode_lock.as_mut()?.turn_on_privacy(conn_id))
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "ios"))]
|
||||
pub(crate) fn close_other_remote_connections_for_privacy(owner_id: i32) {
|
||||
use crate::server::{AuthConnType, AUTHED_CONNS};
|
||||
|
||||
let privacy_mode_lock = PRIVACY_MODE.lock().unwrap();
|
||||
// Ownership can change while the caller validates the capturer.
|
||||
if privacy_mode_lock.as_ref().map(|mode| mode.pre_conn_id()) != Some(owner_id) {
|
||||
return;
|
||||
}
|
||||
for connection in AUTHED_CONNS.lock().unwrap().iter() {
|
||||
if connection.conn_type != AuthConnType::Remote || connection.conn_id == owner_id {
|
||||
continue;
|
||||
}
|
||||
if let Err(err) = connection.sender.send(crate::ipc::Data::Close) {
|
||||
hbb_common::log::debug!(
|
||||
"Failed to close connection {} for privacy mode: {}",
|
||||
connection.conn_id,
|
||||
err
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn turn_off_privacy(conn_id: i32, state: Option<PrivacyModeState>) -> Option<ResultType<()>> {
|
||||
Some(
|
||||
|
||||
@@ -581,17 +581,6 @@ impl RendezvousMediator {
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
Some(rendezvous_message::Union::ConfigureUpdate(cu)) => {
|
||||
let v0 = Config::get_rendezvous_servers();
|
||||
Config::set_option(
|
||||
"rendezvous-servers".to_owned(),
|
||||
cu.rendezvous_servers.join(","),
|
||||
);
|
||||
Config::set_serial(cu.serial);
|
||||
if v0 != Config::get_rendezvous_servers() {
|
||||
Self::restart();
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
Ok(())
|
||||
|
||||
@@ -1145,6 +1145,14 @@ impl Connection {
|
||||
},
|
||||
Some(data) = rx_from_authed.recv() => {
|
||||
match data {
|
||||
ipc::Data::Close => {
|
||||
conn.send(crate::common::make_privacy_mode_msg(
|
||||
back_notification::PrivacyModeState::PrvOnByOther,
|
||||
String::new(),
|
||||
)).await;
|
||||
conn.on_close("privacy mode", false).await;
|
||||
break;
|
||||
}
|
||||
#[cfg(all(target_os = "windows", feature = "flutter"))]
|
||||
ipc::Data::PrinterData(data) => {
|
||||
if Self::permission(keys::OPTION_ENABLE_REMOTE_PRINTER, &conn.control_permissions) {
|
||||
@@ -2027,6 +2035,10 @@ impl Connection {
|
||||
#[cfg(target_os = "linux")]
|
||||
if self.is_remote() {
|
||||
let mut msg = "".to_string();
|
||||
#[cfg(feature = "drm")]
|
||||
if !crate::platform::linux::is_x11_for_drm() {
|
||||
super::drm_capturer::settle_unknown_availability().await;
|
||||
}
|
||||
// Refuse only while nothing can capture a Wayland greeter: the DRM path can.
|
||||
if crate::platform::linux::is_login_screen_wayland() && !drm_can_serve_login_screen() {
|
||||
msg = crate::client::LOGIN_SCREEN_WAYLAND.to_owned()
|
||||
@@ -2451,6 +2463,41 @@ impl Connection {
|
||||
self.tx_input.send(MessageInput::Key((msg, press))).ok();
|
||||
}
|
||||
|
||||
// Auto Login: the password and Return the client would otherwise type itself, typed only if a
|
||||
// check right before finds the logon or lock screen.
|
||||
#[cfg(any(target_os = "windows", target_os = "macos"))]
|
||||
async fn type_auto_login_password(&self, password: String) {
|
||||
// A peer can send this at any rate, hence the throttled logs.
|
||||
let at_logon_screen = tokio::task::spawn_blocking(crate::platform::is_logon_screen)
|
||||
.await
|
||||
.unwrap_or_else(|e| {
|
||||
hbb_common::throttled_log!(
|
||||
Duration::from_secs(60),
|
||||
error,
|
||||
"Failed to check the logon screen: {}",
|
||||
e
|
||||
);
|
||||
false
|
||||
});
|
||||
if !at_logon_screen {
|
||||
hbb_common::throttled_log!(
|
||||
Duration::from_secs(60),
|
||||
info,
|
||||
"Auto login dropped, not at the logon or lock screen"
|
||||
);
|
||||
return;
|
||||
}
|
||||
let mut key_event = KeyEvent::new();
|
||||
key_event.mode = KeyboardMode::Legacy.into();
|
||||
key_event.press = true;
|
||||
key_event.set_seq(password);
|
||||
self.input_key(key_event.clone(), false);
|
||||
key_event.set_control_key(ControlKey::Return);
|
||||
CLICK_TIME.store(get_time(), Ordering::SeqCst);
|
||||
MOUSE_MOVE_TIME.store(get_time(), Ordering::SeqCst);
|
||||
self.input_key(key_event, true);
|
||||
}
|
||||
|
||||
fn verify_h1(&self, h1: &[u8]) -> bool {
|
||||
let mut hasher2 = Sha256::new();
|
||||
hasher2.update(h1);
|
||||
@@ -3343,6 +3390,13 @@ impl Connection {
|
||||
}
|
||||
self.update_auto_disconnect_timer();
|
||||
}
|
||||
#[cfg(any(target_os = "windows", target_os = "macos"))]
|
||||
Some(message::Union::OsLogin(login)) => {
|
||||
if self.peer_keyboard_enabled() {
|
||||
self.type_auto_login_password(login.password).await;
|
||||
}
|
||||
self.update_auto_disconnect_timer();
|
||||
}
|
||||
Some(message::Union::Clipboard(cb)) => {
|
||||
if self.should_handle_text_clipboard_message() && self.clipboard_enabled() {
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
@@ -5138,6 +5192,7 @@ impl Connection {
|
||||
5_000,
|
||||
);
|
||||
if err_msg.is_empty() {
|
||||
privacy_mode::close_other_remote_connections_for_privacy(self.inner.id);
|
||||
crate::common::make_privacy_mode_msg(
|
||||
back_notification::PrivacyModeState::PrvOnSucceeded,
|
||||
impl_key,
|
||||
@@ -5164,10 +5219,10 @@ impl Connection {
|
||||
Some(Err(e)) => {
|
||||
log::error!("Failed to turn on privacy mode. {}", e);
|
||||
if privacy_mode::is_in_privacy_mode() {
|
||||
let _ = Self::turn_off_privacy_to_msg(
|
||||
privacy_mode::INVALID_PRIVACY_MODE_CONN_ID,
|
||||
String::new(),
|
||||
);
|
||||
// Use this connection's ID so a failed request cannot disable another
|
||||
// connection's privacy mode: INVALID_PRIVACY_MODE_CONN_ID would bypass
|
||||
// the ownership check (see `check_off_conn_id`).
|
||||
let _ = Self::turn_off_privacy_to_msg(self.inner.id, String::new());
|
||||
}
|
||||
crate::common::make_privacy_mode_msg_with_details(
|
||||
back_notification::PrivacyModeState::PrvOnFailed,
|
||||
@@ -6101,6 +6156,7 @@ impl Connection {
|
||||
Some(message::Union::TerminalAction(_)) => "terminal_action",
|
||||
Some(message::Union::TerminalResponse(_)) => "terminal_response",
|
||||
Some(message::Union::PortForwardChannel(_)) => "port_forward_channel",
|
||||
Some(message::Union::OsLogin(_)) => "os_login",
|
||||
Some(message::Union::Misc(misc)) => Self::misc_message_family(misc),
|
||||
Some(_) => "message.other",
|
||||
None => "empty",
|
||||
|
||||
+126
-27
@@ -110,6 +110,17 @@ fn connector_key(d: &DrmDisplayInfo) -> String {
|
||||
format!("{}:{}", d.device, d.name)
|
||||
}
|
||||
|
||||
/// The transform whose dimensions the delivered frames have: a plane rotated 90/270 in hardware
|
||||
/// already hands over the transposed scanout (and `frame_transform` then turns nothing), whatever
|
||||
/// the output transform says; otherwise the output transform is undone in software.
|
||||
fn delivered_transform(d: &DrmDisplayInfo, wl_transform: i32) -> i32 {
|
||||
if d.plane_transposed {
|
||||
90
|
||||
} else {
|
||||
wl_transform
|
||||
}
|
||||
}
|
||||
|
||||
/// Frame dimensions after undoing `transform` degrees of output rotation.
|
||||
fn rotated_dims(transform: i32, w: usize, h: usize) -> (usize, usize) {
|
||||
if transform == 90 || transform == 270 {
|
||||
@@ -416,9 +427,13 @@ impl IpcDrmCapturer {
|
||||
stop,
|
||||
display,
|
||||
connector: displays.get(wire_idx).map(connector_key),
|
||||
session_size: displays
|
||||
.get(wire_idx)
|
||||
.map(|d| rotated_dims(wl_transform, d.width as usize, d.height as usize)),
|
||||
session_size: displays.get(wire_idx).map(|d| {
|
||||
rotated_dims(
|
||||
delivered_transform(d, wl_transform),
|
||||
d.width as usize,
|
||||
d.height as usize,
|
||||
)
|
||||
}),
|
||||
transform: wl_transform,
|
||||
snapshot_gen,
|
||||
cur: Vec::new(),
|
||||
@@ -600,6 +615,10 @@ async fn recv_thread(
|
||||
return;
|
||||
}
|
||||
};
|
||||
if let Err(err) = conn.send_msg(&Data::DrmHello { wake: true }, None).await {
|
||||
let _ = tx.send(Err(err));
|
||||
return;
|
||||
}
|
||||
let displays = match conn.recv_msg_timeout2(DISPLAY_LIST_TIMEOUT_MS).await {
|
||||
Some(Ok((Data::DrmDisplayList(v), _fd))) => v,
|
||||
Some(Ok((other, _fd))) => {
|
||||
@@ -1536,12 +1555,12 @@ const NEGATIVE_TTL: Duration = Duration::from_secs(30);
|
||||
const POSITIVE_TTL: Duration = Duration::from_secs(15);
|
||||
|
||||
/// Runs on a throwaway thread: a nested `#[tokio::main]` panics if called from inside a runtime.
|
||||
fn query_displays() -> ResultType<Vec<DrmDisplayInfo>> {
|
||||
fn query_displays(wake: bool) -> ResultType<Vec<DrmDisplayInfo>> {
|
||||
let (tx, rx) = std::sync::mpsc::channel();
|
||||
std::thread::Builder::new()
|
||||
.name("drm-query".into())
|
||||
.spawn(move || {
|
||||
let _ = tx.send(query_displays_async());
|
||||
let _ = tx.send(query_displays_async(wake));
|
||||
})
|
||||
.map_err(|err| anyhow!("could not spawn the drm display query thread: {err}"))?;
|
||||
rx.recv_timeout(Duration::from_millis(HANDSHAKE_WAIT_MS))
|
||||
@@ -1549,12 +1568,13 @@ fn query_displays() -> ResultType<Vec<DrmDisplayInfo>> {
|
||||
}
|
||||
|
||||
#[tokio::main(flavor = "current_thread")]
|
||||
async fn query_displays_async() -> ResultType<Vec<DrmDisplayInfo>> {
|
||||
query_displays_inner().await
|
||||
async fn query_displays_async(wake: bool) -> ResultType<Vec<DrmDisplayInfo>> {
|
||||
query_displays_inner(wake).await
|
||||
}
|
||||
|
||||
async fn query_displays_inner() -> ResultType<Vec<DrmDisplayInfo>> {
|
||||
async fn query_displays_inner(wake: bool) -> ResultType<Vec<DrmDisplayInfo>> {
|
||||
let mut conn = connect_drm(DRM_CONNECT_TIMEOUT_MS).await?;
|
||||
conn.send_msg(&Data::DrmHello { wake }, None).await?;
|
||||
match conn.recv_msg_timeout2(DISPLAY_LIST_TIMEOUT_MS).await {
|
||||
Some(Ok((Data::DrmDisplayList(v), _fd))) => Ok(v),
|
||||
Some(Ok((other, _fd))) => Err(anyhow!("expected DrmDisplayList, got {:?}", other)),
|
||||
@@ -1625,8 +1645,8 @@ pub(crate) enum Availability {
|
||||
Unsettled,
|
||||
}
|
||||
|
||||
/// MAY BLOCK for seconds: never a routing gate, and never on the login request path — that path
|
||||
/// reads `availability_cached`. This blocking form serves the capture-side callers through
|
||||
/// MAY BLOCK for seconds: never on an async executor (a login with no verdict runs it on the
|
||||
/// blocking pool). This blocking form serves the capture-side callers through
|
||||
/// `is_available`, where waiting out a settle is acceptable.
|
||||
fn availability() -> Availability {
|
||||
let (verdict, stale_no) = {
|
||||
@@ -1709,7 +1729,7 @@ pub(crate) fn availability_cached() -> Availability {
|
||||
/// Probe synchronously and publish the outcome. The caller must hold DRM_PROBE_IN_FLIGHT.
|
||||
fn probe_and_publish() -> Availability {
|
||||
let t = Instant::now();
|
||||
let result = query_displays();
|
||||
let result = query_displays(true);
|
||||
let mut st = DRM_STATE.lock().unwrap();
|
||||
let answer = match result {
|
||||
Ok(list) if !list.is_empty() => {
|
||||
@@ -1772,7 +1792,7 @@ fn refresh_unavailable_async() {
|
||||
.name("drm-unavail-refresh".into())
|
||||
.spawn(move || {
|
||||
let _in_flight = in_flight;
|
||||
let result = query_displays();
|
||||
let result = query_displays(true);
|
||||
let mut st = DRM_STATE.lock().unwrap();
|
||||
if DRM_STATE_GEN.load(Ordering::Acquire) != sampled_gen {
|
||||
return;
|
||||
@@ -1816,7 +1836,7 @@ fn refresh_available_async() {
|
||||
.name("drm-avail-refresh".into())
|
||||
.spawn(move || {
|
||||
let _in_flight = in_flight;
|
||||
let result = query_displays();
|
||||
let result = query_displays(true);
|
||||
let mut st = DRM_STATE.lock().unwrap();
|
||||
if DRM_STATE_GEN.load(Ordering::Acquire) != sampled_gen {
|
||||
return;
|
||||
@@ -1881,21 +1901,44 @@ pub(super) fn warm_availability() {
|
||||
std::thread::sleep(Duration::from_millis(300));
|
||||
continue;
|
||||
}
|
||||
if matches!(&*DRM_STATE.lock().unwrap(), ProbeState::Available(..)) {
|
||||
return;
|
||||
}
|
||||
match query_displays() {
|
||||
Ok(list) if !list.is_empty() => {
|
||||
log::info!("drm: consumer cache warmed ({} displays) at startup", list.len());
|
||||
publish_probe_state(&mut DRM_STATE.lock().unwrap(), ProbeState::Available(Instant::now(), list));
|
||||
let sampled_gen = {
|
||||
let st = DRM_STATE.lock().unwrap();
|
||||
if matches!(&*st, ProbeState::Available(..)) {
|
||||
return;
|
||||
}
|
||||
_ => std::thread::sleep(Duration::from_millis(300)),
|
||||
DRM_STATE_GEN.load(Ordering::Acquire)
|
||||
};
|
||||
match query_displays(false) {
|
||||
Ok(list) if !list.is_empty() => {
|
||||
let mut st = DRM_STATE.lock().unwrap();
|
||||
// A login probe that published while this query ran keeps its newer list.
|
||||
if DRM_STATE_GEN.load(Ordering::Acquire) == sampled_gen {
|
||||
log::info!("drm: consumer cache warmed ({} displays) at startup", list.len());
|
||||
publish_probe_state(&mut st, ProbeState::Available(Instant::now(), list));
|
||||
}
|
||||
return;
|
||||
}
|
||||
Ok(_) => {
|
||||
log::info!("drm: no display is lit at startup; the first login probes again");
|
||||
return;
|
||||
}
|
||||
Err(_) => std::thread::sleep(Duration::from_millis(300)),
|
||||
}
|
||||
}
|
||||
log::info!("drm: consumer cache warm found no producer at startup (will probe lazily)");
|
||||
}
|
||||
|
||||
/// With no verdict yet, a login probes now instead of answering "not yet"; that may wake displays.
|
||||
/// A login that finds another probe running does not wait for it.
|
||||
pub(super) async fn settle_unknown_availability() {
|
||||
let unknown = matches!(&*DRM_STATE.lock().unwrap(), ProbeState::Unknown);
|
||||
if unknown {
|
||||
if let Err(err) = tokio::task::spawn_blocking(availability).await {
|
||||
log::warn!("drm: login availability settlement task failed: {err}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The service holds its answer until the topology settles. Replaces only an `Available` verdict.
|
||||
pub(super) async fn refresh_displays_for_login() {
|
||||
let sampled_gen = {
|
||||
@@ -1906,7 +1949,7 @@ pub(super) async fn refresh_displays_for_login() {
|
||||
DRM_STATE_GEN.load(Ordering::Acquire)
|
||||
};
|
||||
let t = Instant::now();
|
||||
match query_displays_inner().await {
|
||||
match query_displays_inner(true).await {
|
||||
Ok(list) if !list.is_empty() => {
|
||||
let changed = {
|
||||
let mut st = DRM_STATE.lock().unwrap();
|
||||
@@ -2094,7 +2137,8 @@ fn augment_with_wayland_geometry_from(
|
||||
// Identity matches ONLY, the same rule the capturer's transform follows: swapping on a
|
||||
// layout-order guess advertises dimensions the capturer will not deliver.
|
||||
let is_identity = identity[i].is_some() && identity[i] == matched[i];
|
||||
if is_identity && (w.transform == 90 || w.transform == 270) {
|
||||
// A plane-transposed display was already swapped by `display_info_from_drm`.
|
||||
if is_identity && !drm[i].plane_transposed && (w.transform == 90 || w.transform == 270) {
|
||||
std::mem::swap(&mut info.width, &mut info.height);
|
||||
info.original_resolution = super::display_service::get_original_resolution(
|
||||
&drm[i].name,
|
||||
@@ -2231,13 +2275,18 @@ fn swap_available_displays(list: Vec<DrmDisplayInfo>) {
|
||||
}
|
||||
|
||||
fn display_info_from_drm(d: &DrmDisplayInfo) -> DisplayInfo {
|
||||
let (width, height) = rotated_dims(
|
||||
delivered_transform(d, 0),
|
||||
d.width as usize,
|
||||
d.height as usize,
|
||||
);
|
||||
let original_resolution =
|
||||
super::display_service::get_original_resolution(&d.name, d.width as usize, d.height as usize);
|
||||
super::display_service::get_original_resolution(&d.name, width, height);
|
||||
DisplayInfo {
|
||||
x: d.x,
|
||||
y: d.y,
|
||||
width: d.width as i32,
|
||||
height: d.height as i32,
|
||||
width: width as i32,
|
||||
height: height as i32,
|
||||
name: d.name.clone(),
|
||||
online: d.active,
|
||||
cursor_embedded: false,
|
||||
@@ -2302,7 +2351,11 @@ pub(super) fn get_capturer_info(
|
||||
// Origin and transform come from the ONE snapshot new() resolved, so both reflect the
|
||||
// same output assignment; dimensions stay PHYSICAL, rotated to frame orientation.
|
||||
let origin = origin.unwrap_or((d.x, d.y));
|
||||
let (cap_w, cap_h) = rotated_dims(capturer.transform, d.width as usize, d.height as usize);
|
||||
let (cap_w, cap_h) = rotated_dims(
|
||||
delivered_transform(&d, capturer.transform),
|
||||
d.width as usize,
|
||||
d.height as usize,
|
||||
);
|
||||
Ok(super::video_service::CapturerInfo {
|
||||
origin,
|
||||
width: cap_w,
|
||||
@@ -3764,6 +3817,7 @@ mod drm_capturer_tests {
|
||||
active: true,
|
||||
render_node: String::new(),
|
||||
device: String::new(),
|
||||
plane_transposed: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3786,6 +3840,51 @@ mod drm_capturer_tests {
|
||||
}
|
||||
}
|
||||
|
||||
fn plane_transposed_display(name: &str, w: u32, h: u32) -> DrmDisplayInfo {
|
||||
DrmDisplayInfo {
|
||||
plane_transposed: true,
|
||||
..drm_display(name, w, h)
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_plane_transposed_display_advertises_its_scanout() {
|
||||
// Steam Deck under gamescope: 800x1280 panel mode, 1280x800 framebuffer on a rotate-270
|
||||
// plane, and no wayland output that matches the connector.
|
||||
let drm = [plane_transposed_display("eDP-1", 800, 1280)];
|
||||
let wl = scrap::wayland::display::Displays {
|
||||
primary: 0,
|
||||
displays: vec![],
|
||||
};
|
||||
let assignment = assign_wayland_outputs(&drm, &wl.displays);
|
||||
let infos = augment_with_wayland_geometry_from(&drm, &wl, &assignment);
|
||||
assert_eq!((infos[0].width, infos[0].height), (1280, 800));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_plane_transposed_scanout_is_delivered_at_the_advertised_size() {
|
||||
let d = plane_transposed_display("eDP-1", 800, 1280);
|
||||
let session = rotated_dims(delivered_transform(&d, 0), d.width as usize, d.height as usize);
|
||||
let mut c = capturer_named(Some(session), Some("test:plane-transposed-session"));
|
||||
put_frame_rot(&c, 1280, 800, Some(0x8));
|
||||
assert!(matches!(c.frame(Duration::from_millis(50)), Ok(_)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_rotated_output_over_a_rotated_plane_is_swapped_once() {
|
||||
// mutter rotates the output and programs the plane from it: one quarter turn, as before.
|
||||
let drm = [plane_transposed_display("HDMI-A-1", 1920, 1080)];
|
||||
let mut out = wl_display("HDMI-1", 0, 0, 1920, 1080);
|
||||
out.transform = 90;
|
||||
let wl = scrap::wayland::display::Displays {
|
||||
primary: 0,
|
||||
displays: vec![out],
|
||||
};
|
||||
let assignment = assign_wayland_outputs(&drm, &wl.displays);
|
||||
let infos = augment_with_wayland_geometry_from(&drm, &wl, &assignment);
|
||||
assert_eq!((infos[0].width, infos[0].height), (1080, 1920));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_lone_rotated_output_advertises_delivered_dimensions() {
|
||||
// Fix for the origin-only cut: one connector, one rotated output. The capturer will
|
||||
|
||||
@@ -710,6 +710,8 @@ struct VirtualInputState {
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
impl VirtualInputState {
|
||||
const KEY_UP_ERROR_LOG_INTERVAL: Duration = Duration::from_secs(5);
|
||||
|
||||
fn new() -> Option<Self> {
|
||||
VirtualInput::new(
|
||||
CGEventSourceStateID::CombinedSessionState,
|
||||
@@ -1657,6 +1659,12 @@ fn simulate_(event_type: &EventType) {
|
||||
let _lock = VIRTUAL_INPUT_MTX.lock();
|
||||
if let Some(input) = VIRTUAL_INPUT_STATE.as_ref() {
|
||||
let _ = input.simulate(&event_type);
|
||||
} else if matches!(event_type, EventType::KeyRelease(_)) {
|
||||
hbb_common::throttled_log!(
|
||||
VirtualInputState::KEY_UP_ERROR_LOG_INTERVAL,
|
||||
error,
|
||||
"Failed to inject macOS key-up: virtual input is not initialized"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2481,6 +2489,9 @@ pub fn handle_key_(evt: &KeyEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
super::uinput::prepare_layout(evt);
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
let mut _lock_mode_handler = None;
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
|
||||
+213
-10
@@ -10,6 +10,12 @@ use hbb_common::{
|
||||
ResultType,
|
||||
};
|
||||
|
||||
mod layout;
|
||||
|
||||
pub(super) fn prepare_layout(event: &base::message_proto::KeyEvent) {
|
||||
layout::prepare_layout(event);
|
||||
}
|
||||
|
||||
static IPC_CONN_TIMEOUT: u64 = 1000;
|
||||
static IPC_REQUEST_TIMEOUT: u64 = 1000;
|
||||
static IPC_POSTFIX_KEYBOARD: &str = "_uinput_keyboard";
|
||||
@@ -17,24 +23,182 @@ static IPC_POSTFIX_MOUSE: &str = "_uinput_mouse";
|
||||
static IPC_POSTFIX_CONTROL: &str = "_uinput_control";
|
||||
|
||||
pub mod client {
|
||||
use super::*;
|
||||
use super::{layout::LayoutKey, *};
|
||||
use std::{collections::HashMap, time::Duration};
|
||||
|
||||
const LAYOUT_ERROR_LOG_INTERVAL: Duration = Duration::from_secs(5);
|
||||
|
||||
struct LayoutContext {
|
||||
locks: (bool, bool),
|
||||
// None for ordinary input; otherwise whether the shortcut holds Shift.
|
||||
shortcut_shift: Option<bool>,
|
||||
}
|
||||
|
||||
impl LayoutContext {
|
||||
fn resolve(&self, chr: char) -> ResultType<LayoutKey> {
|
||||
layout::resolve(chr, self.locks, self.shortcut_shift)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct UInputKeyboard {
|
||||
conn: Connection,
|
||||
rt: Runtime,
|
||||
// Ownership is per character. The Linux connection turns character
|
||||
// downs into clicks; overlapping direct-backend holds can release a
|
||||
// generated modifier still needed by another character.
|
||||
layout_keys: HashMap<char, LayoutKey>,
|
||||
}
|
||||
|
||||
impl UInputKeyboard {
|
||||
pub async fn new() -> ResultType<Self> {
|
||||
let conn = ipc::connect(IPC_CONN_TIMEOUT, IPC_POSTFIX_KEYBOARD).await?;
|
||||
let rt = Runtime::new()?;
|
||||
Ok(Self { conn, rt })
|
||||
layout::prewarm_layout();
|
||||
Ok(Self {
|
||||
conn,
|
||||
rt,
|
||||
layout_keys: HashMap::new(),
|
||||
})
|
||||
}
|
||||
|
||||
fn send(&mut self, data: Data) -> ResultType<()> {
|
||||
self.rt.block_on(self.conn.send(&data))
|
||||
}
|
||||
|
||||
fn send_raw_key(&mut self, keycode: u16, down: bool) -> ResultType<()> {
|
||||
let key = Key::Raw(keycode);
|
||||
let event = if down {
|
||||
DataKeyboard::KeyDown(key)
|
||||
} else {
|
||||
DataKeyboard::KeyUp(key)
|
||||
};
|
||||
self.send(Data::Keyboard(event))
|
||||
}
|
||||
|
||||
fn press_layout_key(&mut self, chr: char, mapping: LayoutKey) -> ResultType<()> {
|
||||
if let Some(pressed) = self.layout_keys.get(&chr).cloned() {
|
||||
return self.send_layout_key_down(&pressed);
|
||||
}
|
||||
let mut pressed = LayoutKey {
|
||||
key: mapping.key,
|
||||
modifiers: Vec::new(),
|
||||
};
|
||||
for keycode in mapping.modifiers {
|
||||
let query = Data::Keyboard(DataKeyboard::GetKeyState(Key::Raw(keycode)));
|
||||
if !self.send_get_key_state(query)? {
|
||||
pressed.modifiers.push(keycode);
|
||||
}
|
||||
}
|
||||
let result = self.send_layout_key_down(&pressed);
|
||||
if let Err(error) = result {
|
||||
if let Err(release_error) = self.release_layout_key(&pressed) {
|
||||
bail!(
|
||||
"{}; failed to release uinput modifiers: {}",
|
||||
error,
|
||||
release_error
|
||||
);
|
||||
}
|
||||
return Err(error);
|
||||
}
|
||||
self.layout_keys.insert(chr, pressed);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn send_layout_key_down(&mut self, pressed: &LayoutKey) -> ResultType<()> {
|
||||
// Character dispatch can release Shift before a repeated key-down.
|
||||
for keycode in &pressed.modifiers {
|
||||
self.send_raw_key(*keycode, true)?;
|
||||
}
|
||||
self.send(Data::Keyboard(DataKeyboard::KeyDown(pressed.key)))
|
||||
}
|
||||
|
||||
fn release_layout_key(&mut self, pressed: &LayoutKey) -> ResultType<()> {
|
||||
let mut result = self.send(Data::Keyboard(DataKeyboard::KeyUp(pressed.key)));
|
||||
for keycode in pressed.modifiers.iter().rev() {
|
||||
// Attempt every release even if an earlier send failed.
|
||||
result = result.and(self.send_raw_key(*keycode, false));
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
fn layout_key_down(&mut self, chr: char) -> ResultType<()> {
|
||||
if let Some(pressed) = self.layout_keys.get(&chr).cloned() {
|
||||
return self.send_layout_key_down(&pressed);
|
||||
}
|
||||
let mapping = if layout::is_available() {
|
||||
self.layout_context()?.resolve(chr)?
|
||||
} else {
|
||||
// Discovery may finish before key-up; retain the legacy key for release.
|
||||
LayoutKey {
|
||||
key: Key::Layout(chr),
|
||||
modifiers: Vec::new(),
|
||||
}
|
||||
};
|
||||
self.press_layout_key(chr, mapping)
|
||||
}
|
||||
|
||||
fn layout_key_up(&mut self, chr: char) -> ResultType<()> {
|
||||
if let Some(pressed) = self.layout_keys.remove(&chr) {
|
||||
self.release_layout_key(&pressed)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn layout_key_sequence(&mut self, sequence: &str) -> ResultType<()> {
|
||||
if sequence.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
let context = self.layout_context()?;
|
||||
// Keep supported text after a mapping failure and report the first error.
|
||||
// Modifier and IPC failures must still stop the sequence immediately.
|
||||
let mut result = Ok(());
|
||||
for chr in sequence.chars() {
|
||||
let mapping = match context.resolve(chr) {
|
||||
Ok(mapping) => mapping,
|
||||
Err(error) => {
|
||||
result = result.and(Err(error));
|
||||
continue;
|
||||
}
|
||||
};
|
||||
self.press_layout_key(chr, mapping)?;
|
||||
self.layout_key_up(chr)?;
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
fn layout_context(&mut self) -> ResultType<LayoutContext> {
|
||||
let caps_lock =
|
||||
self.send_get_key_state(Data::Keyboard(DataKeyboard::GetKeyState(Key::CapsLock)))?;
|
||||
let num_lock =
|
||||
self.send_get_key_state(Data::Keyboard(DataKeyboard::GetKeyState(Key::NumLock)))?;
|
||||
let shortcut = self
|
||||
.send_get_key_state(Data::Keyboard(DataKeyboard::GetKeyState(Key::Control)))?
|
||||
|| self.send_get_key_state(Data::Keyboard(DataKeyboard::GetKeyState(Key::Alt)))?
|
||||
|| self.send_get_key_state(Data::Keyboard(DataKeyboard::GetKeyState(Key::Meta)))?;
|
||||
let shortcut_shift = if shortcut {
|
||||
Some(
|
||||
self.send_get_key_state(Data::Keyboard(DataKeyboard::GetKeyState(Key::Shift)))?,
|
||||
)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
Ok(LayoutContext {
|
||||
locks: (caps_lock, num_lock),
|
||||
shortcut_shift,
|
||||
})
|
||||
}
|
||||
|
||||
fn log_layout_error(result: &ResultType<()>) {
|
||||
if let Err(error) = result {
|
||||
hbb_common::throttled_log!(
|
||||
LAYOUT_ERROR_LOG_INTERVAL,
|
||||
error,
|
||||
"Uinput layout-aware keyboard input failed: {}",
|
||||
error
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn send_get_key_state(&mut self, data: Data) -> ResultType<bool> {
|
||||
self.rt.block_on(self.conn.send(&data))?;
|
||||
|
||||
@@ -45,6 +209,9 @@ pub mod client {
|
||||
Ok(Some(Data::KeyboardResponse(ipc::DataKeyboardResponse::GetKeyState(state)))) => {
|
||||
Ok(state)
|
||||
}
|
||||
Ok(Some(Data::KeyboardResponse(ipc::DataKeyboardResponse::GetKeyStateError(
|
||||
error,
|
||||
)))) => bail!("Failed to query uinput key state: {}", error),
|
||||
Ok(Some(resp)) => {
|
||||
// FATAL error!!!
|
||||
bail!(
|
||||
@@ -90,25 +257,39 @@ pub mod client {
|
||||
}
|
||||
|
||||
fn key_sequence(&mut self, sequence: &str) {
|
||||
// Sequence events are normally handled in the --server process before reaching here.
|
||||
// Forward via IPC as a fallback — input_text_wayland can still handle ASCII chars
|
||||
// via keysym/uinput, though non-ASCII will be skipped (no clipboard in --service).
|
||||
log::debug!(
|
||||
"UInputKeyboard::key_sequence called (len={})",
|
||||
sequence.len()
|
||||
);
|
||||
allow_err!(self.send(Data::Keyboard(DataKeyboard::Sequence(sequence.to_string()))));
|
||||
if !layout::is_available() {
|
||||
Self::log_layout_error(
|
||||
&self.send(Data::Keyboard(DataKeyboard::Sequence(sequence.to_string()))),
|
||||
);
|
||||
return;
|
||||
}
|
||||
Self::log_layout_error(&self.layout_key_sequence(sequence));
|
||||
}
|
||||
|
||||
// TODO: handle error???
|
||||
fn key_down(&mut self, key: Key) -> enigo::ResultType {
|
||||
if let Key::Layout(chr) = key {
|
||||
let result = self.layout_key_down(chr);
|
||||
Self::log_layout_error(&result);
|
||||
return result.map_err(Into::into);
|
||||
}
|
||||
allow_err!(self.send(Data::Keyboard(DataKeyboard::KeyDown(key))));
|
||||
Ok(())
|
||||
}
|
||||
fn key_up(&mut self, key: Key) {
|
||||
if let Key::Layout(chr) = key {
|
||||
Self::log_layout_error(&self.layout_key_up(chr));
|
||||
return;
|
||||
}
|
||||
allow_err!(self.send(Data::Keyboard(DataKeyboard::KeyUp(key))));
|
||||
}
|
||||
fn key_click(&mut self, key: Key) {
|
||||
if let Key::Layout(chr) = key {
|
||||
if layout::is_available() {
|
||||
Self::log_layout_error(&self.layout_key_sequence(&chr.to_string()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
allow_err!(self.send(Data::Keyboard(DataKeyboard::KeyClick(key))));
|
||||
}
|
||||
}
|
||||
@@ -203,6 +384,8 @@ pub mod service {
|
||||
use std::os::unix::io::AsRawFd;
|
||||
use std::{collections::HashMap, sync::Mutex};
|
||||
|
||||
const RAW_KEY_STATE_ERROR_LOG_INTERVAL: std::time::Duration = std::time::Duration::from_secs(5);
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref KEY_MAP: HashMap<enigo::Key, evdev::Key> = HashMap::from(
|
||||
[
|
||||
@@ -686,6 +869,9 @@ pub mod service {
|
||||
} else {
|
||||
match keyboard.get_key_state() {
|
||||
Ok(keys) => match key {
|
||||
enigo::Key::Raw(code) if *code >= layout::XKB_KEYCODE_OFFSET => {
|
||||
keys.contains(evdev::Key::new(*code - layout::XKB_KEYCODE_OFFSET))
|
||||
}
|
||||
enigo::Key::Shift => {
|
||||
keys.contains(evdev::Key::KEY_LEFTSHIFT)
|
||||
|| keys.contains(evdev::Key::KEY_RIGHTSHIFT)
|
||||
@@ -704,6 +890,23 @@ pub mod service {
|
||||
}
|
||||
_ => false,
|
||||
},
|
||||
Err(error) if matches!(key, enigo::Key::Raw(_)) => {
|
||||
hbb_common::throttled_log!(
|
||||
RAW_KEY_STATE_ERROR_LOG_INTERVAL,
|
||||
error,
|
||||
"Failed to query uinput layout modifier state: {}",
|
||||
error
|
||||
);
|
||||
// Unknown modifier state must not be treated as released.
|
||||
ipc_send_data(
|
||||
stream,
|
||||
&Data::KeyboardResponse(
|
||||
ipc::DataKeyboardResponse::GetKeyStateError(error.to_string()),
|
||||
),
|
||||
)
|
||||
.await;
|
||||
return;
|
||||
}
|
||||
Err(_e) => {
|
||||
// log::debug!("Failed to get key state: {}", &_e);
|
||||
false
|
||||
|
||||
@@ -0,0 +1,298 @@
|
||||
use hbb_common::{anyhow::anyhow, bail, ResultType};
|
||||
use std::{collections::HashMap, ops::RangeInclusive, ptr::NonNull};
|
||||
use xkbcommon_dl::{self as xkb, keysyms};
|
||||
|
||||
mod cache;
|
||||
mod source;
|
||||
mod wayland;
|
||||
mod xwayland;
|
||||
|
||||
pub(super) use cache::{is_available, prepare_layout, prewarm_layout, resolve};
|
||||
|
||||
pub(super) const XKB_KEYCODE_OFFSET: u16 = 8;
|
||||
const CAPS_LOCK_BIT: usize = 1;
|
||||
const NUM_LOCK_BIT: usize = 2;
|
||||
const SHIFT_BIT: usize = 4;
|
||||
const LAYOUT_STATE_COUNT: usize = 8;
|
||||
const DEFAULT_GROUP: u32 = 0;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub(super) struct LayoutKey {
|
||||
pub key: enigo::Key,
|
||||
pub modifiers: Vec<u16>,
|
||||
}
|
||||
|
||||
struct Keymap {
|
||||
maps: [HashMap<char, LayoutKey>; LAYOUT_STATE_COUNT],
|
||||
}
|
||||
|
||||
impl Keymap {
|
||||
fn load(source: &source::Source) -> ResultType<Self> {
|
||||
let keymap = XkbKeymap::open(source)?;
|
||||
let mut state = State::new(&keymap)?;
|
||||
let caps = state.locked_mask(keysyms::Caps_Lock);
|
||||
let num = state.locked_mask(keysyms::Num_Lock);
|
||||
let shift = state.modifier(&[keysyms::Shift_L, keysyms::Shift_R]);
|
||||
let level3 = state.modifier(&[keysyms::ISO_Level3_Shift]);
|
||||
let modifiers = [shift, level3];
|
||||
let maps = std::array::from_fn(|index| {
|
||||
let locked = if index & CAPS_LOCK_BIT != 0 { caps } else { 0 }
|
||||
| if index & NUM_LOCK_BIT != 0 { num } else { 0 };
|
||||
let held_shift = if index & SHIFT_BIT != 0 { shift } else { None };
|
||||
let modifiers = if held_shift.is_some() {
|
||||
std::slice::from_ref(&level3)
|
||||
} else {
|
||||
&modifiers
|
||||
};
|
||||
state.mappings(locked, modifiers, held_shift)
|
||||
});
|
||||
Ok(Self { maps })
|
||||
}
|
||||
}
|
||||
|
||||
struct XkbKeymap {
|
||||
api: &'static xkb::XkbCommon,
|
||||
map: NonNull<xkb::xkb_keymap>,
|
||||
group: u32,
|
||||
}
|
||||
|
||||
impl XkbKeymap {
|
||||
fn open(source: &source::Source) -> ResultType<Self> {
|
||||
let api = xkb::xkbcommon_option().ok_or_else(|| anyhow!("Cannot load libxkbcommon"))?;
|
||||
let mut keymap = Self {
|
||||
api,
|
||||
map: compile(api, source)?,
|
||||
group: DEFAULT_GROUP,
|
||||
};
|
||||
let groups = unsafe { (api.xkb_keymap_num_layouts)(keymap.map.as_ptr()) };
|
||||
if let source::Source::Wayland { group, .. } | source::Source::Xwayland { group, .. } =
|
||||
source
|
||||
{
|
||||
if groups > 1 {
|
||||
keymap.group =
|
||||
group.ok_or_else(|| anyhow!("Cannot determine the active XKB group"))?;
|
||||
}
|
||||
}
|
||||
if keymap.group >= groups {
|
||||
bail!("The detected keyboard layout group is absent from the keymap");
|
||||
}
|
||||
Ok(keymap)
|
||||
}
|
||||
|
||||
fn keycodes(&self) -> RangeInclusive<u32> {
|
||||
unsafe {
|
||||
(self.api.xkb_keymap_min_keycode)(self.map.as_ptr())
|
||||
..=(self.api.xkb_keymap_max_keycode)(self.map.as_ptr())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for XkbKeymap {
|
||||
fn drop(&mut self) {
|
||||
unsafe { (self.api.xkb_keymap_unref)(self.map.as_ptr()) };
|
||||
}
|
||||
}
|
||||
|
||||
fn compile(api: &xkb::XkbCommon, source: &source::Source) -> ResultType<NonNull<xkb::xkb_keymap>> {
|
||||
let context =
|
||||
unsafe { (api.xkb_context_new)(xkb::xkb_context_flags::XKB_CONTEXT_NO_ENVIRONMENT_NAMES) };
|
||||
let context = NonNull::new(context).ok_or_else(|| anyhow!("Cannot create XKB context"))?;
|
||||
let flags = xkb::xkb_keymap_compile_flags::XKB_KEYMAP_COMPILE_NO_FLAGS;
|
||||
let map = unsafe {
|
||||
match source {
|
||||
source::Source::Gnome(names) => {
|
||||
let names = xkb::xkb_rule_names {
|
||||
rules: std::ptr::null(),
|
||||
model: names.model.as_ptr(),
|
||||
layout: names.layout.as_ptr(),
|
||||
variant: names.variant.as_ptr(),
|
||||
options: names.options.as_ptr(),
|
||||
};
|
||||
(api.xkb_keymap_new_from_names)(context.as_ptr(), &names, flags)
|
||||
}
|
||||
source::Source::Wayland { keymap: bytes, .. }
|
||||
| source::Source::Xwayland { keymap: bytes, .. } => (api.xkb_keymap_new_from_string)(
|
||||
context.as_ptr(),
|
||||
bytes.as_ptr().cast(),
|
||||
xkb::xkb_keymap_format::XKB_KEYMAP_FORMAT_TEXT_V1,
|
||||
flags,
|
||||
),
|
||||
}
|
||||
};
|
||||
unsafe { (api.xkb_context_unref)(context.as_ptr()) };
|
||||
NonNull::new(map).ok_or_else(|| anyhow!("Cannot compile the detected XKB keyboard map"))
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
struct Modifier {
|
||||
keycode: u16,
|
||||
mask: u32,
|
||||
}
|
||||
|
||||
struct State<'a> {
|
||||
keymap: &'a XkbKeymap,
|
||||
state: NonNull<xkb::xkb_state>,
|
||||
}
|
||||
|
||||
impl<'a> State<'a> {
|
||||
fn new(keymap: &'a XkbKeymap) -> ResultType<Self> {
|
||||
let state = unsafe { (keymap.api.xkb_state_new)(keymap.map.as_ptr()) };
|
||||
let state = NonNull::new(state).ok_or_else(|| anyhow!("Cannot create XKB state"))?;
|
||||
let mut state = Self { keymap, state };
|
||||
state.set_modifiers(0, 0);
|
||||
Ok(state)
|
||||
}
|
||||
|
||||
fn set_modifiers(&mut self, depressed: u32, locked: u32) {
|
||||
unsafe {
|
||||
(self.keymap.api.xkb_state_update_mask)(
|
||||
self.state.as_ptr(),
|
||||
depressed,
|
||||
0,
|
||||
locked,
|
||||
0,
|
||||
0,
|
||||
self.keymap.group,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn symbol(&self, keycode: u16) -> u32 {
|
||||
unsafe {
|
||||
(self.keymap.api.xkb_state_key_get_one_sym)(self.state.as_ptr(), u32::from(keycode))
|
||||
}
|
||||
}
|
||||
|
||||
fn update_key(&mut self, keycode: u16, direction: xkb::xkb_key_direction) {
|
||||
unsafe {
|
||||
(self.keymap.api.xkb_state_update_key)(
|
||||
self.state.as_ptr(),
|
||||
u32::from(keycode),
|
||||
direction,
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
fn locked_mask(&mut self, symbol: u32) -> u32 {
|
||||
let keycode = self
|
||||
.keymap
|
||||
.keycodes()
|
||||
.filter_map(supported_keycode)
|
||||
.find(|keycode| self.symbol(*keycode) == symbol);
|
||||
let Some(keycode) = keycode else { return 0 };
|
||||
self.update_key(keycode, xkb::xkb_key_direction::XKB_KEY_DOWN);
|
||||
self.update_key(keycode, xkb::xkb_key_direction::XKB_KEY_UP);
|
||||
let mask = unsafe {
|
||||
(self.keymap.api.xkb_state_serialize_mods)(
|
||||
self.state.as_ptr(),
|
||||
xkb::xkb_state_component::XKB_STATE_MODS_LOCKED,
|
||||
)
|
||||
};
|
||||
self.set_modifiers(0, 0);
|
||||
mask
|
||||
}
|
||||
|
||||
fn modifier(&mut self, symbols: &[u32]) -> Option<Modifier> {
|
||||
// Prefer physical modifier keys to XKB's synthetic <LVL3> keycode.
|
||||
let preferred = [
|
||||
evdev::Key::KEY_LEFTSHIFT,
|
||||
evdev::Key::KEY_RIGHTSHIFT,
|
||||
evdev::Key::KEY_RIGHTALT,
|
||||
];
|
||||
let preferred = preferred
|
||||
.iter()
|
||||
.map(|key| u32::from(key.code() + XKB_KEYCODE_OFFSET));
|
||||
for keycode in preferred
|
||||
.chain(self.keymap.keycodes())
|
||||
.filter_map(supported_keycode)
|
||||
{
|
||||
if !symbols.contains(&self.symbol(keycode)) {
|
||||
continue;
|
||||
}
|
||||
self.update_key(keycode, xkb::xkb_key_direction::XKB_KEY_DOWN);
|
||||
let mask = unsafe {
|
||||
(self.keymap.api.xkb_state_serialize_mods)(
|
||||
self.state.as_ptr(),
|
||||
xkb::xkb_state_component::XKB_STATE_MODS_DEPRESSED,
|
||||
)
|
||||
};
|
||||
self.update_key(keycode, xkb::xkb_key_direction::XKB_KEY_UP);
|
||||
self.set_modifiers(0, 0);
|
||||
if mask != 0 {
|
||||
return Some(Modifier { keycode, mask });
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
fn mappings(
|
||||
&mut self,
|
||||
locked: u32,
|
||||
modifiers: &[Option<Modifier>],
|
||||
held_shift: Option<Modifier>,
|
||||
) -> HashMap<char, LayoutKey> {
|
||||
let mut mappings = HashMap::new();
|
||||
let mut keypad_mappings = HashMap::new();
|
||||
for combination in 0..(1usize << modifiers.len()) {
|
||||
let selected: Vec<_> = modifiers
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter(|(index, _)| combination & (1 << *index) != 0)
|
||||
.filter_map(|(_, modifier)| *modifier)
|
||||
.collect();
|
||||
// Held Shift affects the symbol, but belongs to the caller.
|
||||
let mask = selected.iter().fold(
|
||||
held_shift.map_or(0, |modifier| modifier.mask),
|
||||
|mask, modifier| mask | modifier.mask,
|
||||
);
|
||||
self.set_modifiers(mask, locked);
|
||||
for keycode in self.keymap.keycodes().filter_map(supported_keycode) {
|
||||
let symbol = self.symbol(keycode);
|
||||
// Keypad aliases can produce the same text but different shortcuts.
|
||||
let candidates = if (keysyms::KP_Space..=keysyms::KP_Equal).contains(&symbol) {
|
||||
&mut keypad_mappings
|
||||
} else {
|
||||
&mut mappings
|
||||
};
|
||||
let codepoint = unsafe { (self.keymap.api.xkb_keysym_to_utf32)(symbol) };
|
||||
if let Some(character) =
|
||||
char::from_u32(codepoint).filter(|character| *character != '\0')
|
||||
{
|
||||
candidates.entry(character).or_insert_with(|| LayoutKey {
|
||||
key: enigo::Key::Raw(keycode),
|
||||
// Press Level3 first to avoid Shift+RightAlt activating Compose.
|
||||
// Candidate preference still follows the original modifier order.
|
||||
modifiers: selected
|
||||
.iter()
|
||||
.rev()
|
||||
.map(|modifier| modifier.keycode)
|
||||
.collect(),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
// Shift must not redirect an ordinary shortcut to a keypad alias.
|
||||
if held_shift.is_none() {
|
||||
for (character, mapping) in keypad_mappings {
|
||||
mappings.entry(character).or_insert(mapping);
|
||||
}
|
||||
}
|
||||
mappings
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for State<'_> {
|
||||
fn drop(&mut self) {
|
||||
unsafe { (self.keymap.api.xkb_state_unref)(self.state.as_ptr()) };
|
||||
}
|
||||
}
|
||||
|
||||
fn supported_keycode(keycode: u32) -> Option<u16> {
|
||||
let keycode = u16::try_from(keycode).ok()?;
|
||||
let code = keycode.checked_sub(XKB_KEYCODE_OFFSET)?;
|
||||
// Match the keys enabled by create_uinput_keyboard().
|
||||
let supported = (evdev::Key::KEY_ESC.code()..=evdev::Key::BTN_TRIGGER_HAPPY40.code())
|
||||
.contains(&code)
|
||||
&& !format!("{:?}", evdev::Key::new(code)).contains("unknown");
|
||||
supported.then_some(keycode)
|
||||
}
|
||||
@@ -0,0 +1,259 @@
|
||||
use super::{source::Source, Keymap, LayoutKey, CAPS_LOCK_BIT, NUM_LOCK_BIT, SHIFT_BIT};
|
||||
use crate::server::input_service::is_ascii_printable;
|
||||
use base::message_proto::{key_event, KeyEvent, KeyboardMode};
|
||||
use hbb_common::{bail, lazy_static, ResultType};
|
||||
use std::{
|
||||
sync::{mpsc, Mutex, RwLock, TryLockError},
|
||||
thread,
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
|
||||
const LAYOUT_REFRESH_INTERVAL: Duration = Duration::from_secs(1);
|
||||
// GNOME 46/Plasma 6.6 probes (200-400 initial samples): preparation p99 7-16 ms;
|
||||
// repeated refresh medians were 2-6 ms. KDE query outliers exceeded 100 ms,
|
||||
// so this limits input waiting while the background query continues.
|
||||
const LAYOUT_INPUT_WAIT: Duration = Duration::from_millis(25);
|
||||
const LAYOUT_WARNING_INTERVAL: Duration = Duration::from_secs(5);
|
||||
|
||||
lazy_static::lazy_static! {
|
||||
static ref REFRESH: Mutex<Refresh> = Mutex::new(Refresh::default());
|
||||
// Only the first relevant input takes the startup query's completion receiver.
|
||||
static ref PREWARM_RECEIVER: Mutex<Option<mpsc::Receiver<()>>> = Mutex::new(None);
|
||||
static ref CURRENT: RwLock<Result<Keymap, String>> =
|
||||
RwLock::new(Err("Uinput keyboard layout has not been detected".to_owned()));
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
struct Refresh {
|
||||
checked: Option<Instant>,
|
||||
source: Option<Source>,
|
||||
// Cover scheduling until the worker acquires REFRESH.
|
||||
running: bool,
|
||||
}
|
||||
|
||||
pub(in crate::server::uinput) fn prepare_layout(event: &KeyEvent) {
|
||||
if !crate::server::input_service::wayland_use_uinput() || !needs_layout(event) {
|
||||
return;
|
||||
}
|
||||
let deadline = Instant::now() + LAYOUT_INPUT_WAIT;
|
||||
let receiver = {
|
||||
let mut prewarm = PREWARM_RECEIVER.lock().unwrap();
|
||||
// Prefer a due refresh over an old, already-completed startup query.
|
||||
start_refresh().or(prewarm.take())
|
||||
};
|
||||
if let Some(receiver) = receiver {
|
||||
wait_for_refresh(receiver, deadline);
|
||||
}
|
||||
}
|
||||
|
||||
pub(in crate::server::uinput) fn prewarm_layout() {
|
||||
// Use server startup time for discovery before the first remote character.
|
||||
// This reduces cold-start fallback; a still-pending query cannot guarantee readiness.
|
||||
let mut prewarm = PREWARM_RECEIVER.lock().unwrap();
|
||||
if let Some(receiver) = start_refresh() {
|
||||
*prewarm = Some(receiver);
|
||||
}
|
||||
}
|
||||
|
||||
fn start_refresh() -> Option<mpsc::Receiver<()>> {
|
||||
// A stalled desktop query must not block later input or spawn more workers.
|
||||
let mut refresh = match REFRESH.try_lock() {
|
||||
Ok(refresh) => refresh,
|
||||
Err(TryLockError::WouldBlock) => return None,
|
||||
Err(TryLockError::Poisoned(error)) => {
|
||||
hbb_common::throttled_log!(
|
||||
LAYOUT_WARNING_INTERVAL,
|
||||
error,
|
||||
"Uinput layout refresh lock is poisoned: {}",
|
||||
error
|
||||
);
|
||||
return None;
|
||||
}
|
||||
};
|
||||
if refresh.running
|
||||
|| refresh
|
||||
.checked
|
||||
.is_some_and(|checked| checked.elapsed() < LAYOUT_REFRESH_INTERVAL)
|
||||
{
|
||||
return None;
|
||||
}
|
||||
let (completed, receiver) = mpsc::channel();
|
||||
refresh.running = true;
|
||||
if let Err(error) = thread::Builder::new()
|
||||
.name("uinput-layout".to_owned())
|
||||
.spawn(move || refresh_layout(completed))
|
||||
{
|
||||
refresh.running = false;
|
||||
refresh.checked = Some(Instant::now());
|
||||
hbb_common::throttled_log!(
|
||||
LAYOUT_WARNING_INTERVAL,
|
||||
error,
|
||||
"Cannot start uinput layout refresh: {}",
|
||||
error
|
||||
);
|
||||
return None;
|
||||
}
|
||||
drop(refresh);
|
||||
Some(receiver)
|
||||
}
|
||||
|
||||
fn refresh_layout(completed: mpsc::Sender<()>) {
|
||||
let mut refresh = REFRESH.lock().unwrap();
|
||||
if let Err(error) = refresh.update() {
|
||||
let retained = {
|
||||
let mut current = CURRENT.write().unwrap();
|
||||
if current.is_err() {
|
||||
*current = Err(error.to_string());
|
||||
}
|
||||
current.is_ok()
|
||||
};
|
||||
hbb_common::throttled_log!(
|
||||
LAYOUT_WARNING_INTERVAL,
|
||||
warn,
|
||||
"Uinput layout refresh failed (previous mapping retained: {}): {}",
|
||||
retained,
|
||||
error
|
||||
);
|
||||
}
|
||||
refresh.checked = Some(Instant::now());
|
||||
refresh.running = false;
|
||||
drop(refresh);
|
||||
// An input timeout drops its receiver but leaves this worker running.
|
||||
if completed.send(()).is_err() {
|
||||
hbb_common::log::trace!("Uinput layout refresh finished without an input waiter");
|
||||
}
|
||||
}
|
||||
|
||||
fn wait_for_refresh(receiver: mpsc::Receiver<()>, deadline: Instant) {
|
||||
match receiver.recv_timeout(deadline.saturating_duration_since(Instant::now())) {
|
||||
Ok(()) => {}
|
||||
Err(mpsc::RecvTimeoutError::Timeout) => hbb_common::throttled_log!(
|
||||
LAYOUT_WARNING_INTERVAL,
|
||||
warn,
|
||||
"Uinput layout refresh exceeded the {} ms input wait; query continues in the background",
|
||||
LAYOUT_INPUT_WAIT.as_millis()
|
||||
),
|
||||
Err(mpsc::RecvTimeoutError::Disconnected) => hbb_common::throttled_log!(
|
||||
LAYOUT_WARNING_INTERVAL,
|
||||
error,
|
||||
"Uinput layout refresh worker stopped before completion"
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
impl Refresh {
|
||||
fn update(&mut self) -> ResultType<()> {
|
||||
let source = Source::read().map_err(|error| {
|
||||
if error.is::<super::source::UnreliableSource>() {
|
||||
// Unlike a transient query failure, this invalidates the old map.
|
||||
self.source = None;
|
||||
*CURRENT.write().unwrap() = Err(error.to_string());
|
||||
}
|
||||
error
|
||||
})?;
|
||||
if self.source.as_ref() == Some(&source) {
|
||||
return Ok(());
|
||||
}
|
||||
let keymap = match Keymap::load(&source) {
|
||||
Ok(keymap) => keymap,
|
||||
Err(error) => {
|
||||
// A newly observed layout cannot use the previous layout's map.
|
||||
self.source = None;
|
||||
*CURRENT.write().unwrap() = Err(error.to_string());
|
||||
return Err(error);
|
||||
}
|
||||
};
|
||||
*CURRENT.write().unwrap() = Ok(keymap);
|
||||
self.source = Some(source);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
fn needs_layout(event: &KeyEvent) -> bool {
|
||||
let mode = event.mode.enum_value_or(KeyboardMode::Legacy);
|
||||
if mode == KeyboardMode::Map {
|
||||
return false;
|
||||
}
|
||||
match &event.union {
|
||||
Some(key_event::Union::Seq(sequence)) => {
|
||||
// Translate shortcuts use Key::Layout even for non-ASCII text.
|
||||
!sequence.is_empty()
|
||||
&& (mode == KeyboardMode::Translate || sequence.chars().all(is_ascii_printable))
|
||||
}
|
||||
Some(key_event::Union::Chr(_)) => mode == KeyboardMode::Legacy && event.down,
|
||||
Some(key_event::Union::Unicode(character)) => {
|
||||
mode == KeyboardMode::Legacy
|
||||
&& char::from_u32(*character).is_some_and(is_ascii_printable)
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub(in crate::server::uinput) fn is_available() -> bool {
|
||||
let current = CURRENT.read().unwrap();
|
||||
if let Err(error) = current.as_ref() {
|
||||
hbb_common::throttled_log!(
|
||||
LAYOUT_WARNING_INTERVAL,
|
||||
warn,
|
||||
"Uinput layout unavailable: {}; using legacy character mapping (may differ from the host layout)",
|
||||
error
|
||||
);
|
||||
}
|
||||
current.is_ok()
|
||||
}
|
||||
|
||||
pub(in crate::server::uinput) fn resolve(
|
||||
character: char,
|
||||
locks: (bool, bool),
|
||||
shortcut_shift: Option<bool>,
|
||||
) -> ResultType<LayoutKey> {
|
||||
let current = CURRENT.read().unwrap();
|
||||
let keymap = match current.as_ref() {
|
||||
Ok(keymap) => keymap,
|
||||
Err(error) => {
|
||||
hbb_common::throttled_log!(
|
||||
LAYOUT_WARNING_INTERVAL,
|
||||
warn,
|
||||
"Uinput layout unavailable: {}; using legacy character mapping (may differ from the host layout)",
|
||||
error
|
||||
);
|
||||
return Ok(LayoutKey {
|
||||
key: enigo::Key::Layout(character),
|
||||
modifiers: Vec::new(),
|
||||
});
|
||||
}
|
||||
};
|
||||
let index = usize::from(locks.0) * CAPS_LOCK_BIT + usize::from(locks.1) * NUM_LOCK_BIT;
|
||||
// Letter shortcuts keep their physical key even when Shift changes case.
|
||||
// Other shortcuts prefer a symbol compatible with the caller's held Shift.
|
||||
let shifted = (shortcut_shift == Some(true) && !character.is_alphabetic())
|
||||
.then(|| keymap.maps[index | SHIFT_BIT].get(&character))
|
||||
.flatten();
|
||||
if let Some(mapping) = shifted.or_else(|| keymap.maps[index].get(&character)) {
|
||||
return Ok(mapping.clone());
|
||||
}
|
||||
if shortcut_shift.is_some() && character.is_ascii_graphic() {
|
||||
return legacy_shortcut(character);
|
||||
}
|
||||
bail!("Character cannot be generated in the detected XKB layout")
|
||||
}
|
||||
|
||||
fn legacy_shortcut(character: char) -> ResultType<LayoutKey> {
|
||||
// Uppercase letters must not synthesize Shift for a shortcut, but shifted
|
||||
// punctuation still needs the legacy table's modifier.
|
||||
let (key, shift) =
|
||||
super::super::service::map_key(&enigo::Key::Layout(character.to_ascii_lowercase()))?;
|
||||
hbb_common::throttled_log!(
|
||||
LAYOUT_WARNING_INTERVAL,
|
||||
warn,
|
||||
"Uinput layout lacks an ASCII shortcut character; using its legacy physical mapping"
|
||||
);
|
||||
Ok(LayoutKey {
|
||||
key: enigo::Key::Raw(key.code() + super::XKB_KEYCODE_OFFSET),
|
||||
modifiers: if shift {
|
||||
vec![evdev::Key::KEY_LEFTSHIFT.code() + super::XKB_KEYCODE_OFFSET]
|
||||
} else {
|
||||
Vec::new()
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
use dbus::blocking::Connection;
|
||||
use gtk::{
|
||||
gio::{self, prelude::SettingsExt},
|
||||
glib::variant::FromVariant,
|
||||
};
|
||||
use hbb_common::{anyhow::anyhow, bail, ResultType};
|
||||
use std::{error::Error, ffi::CString, fmt, time::Duration};
|
||||
|
||||
mod ibus;
|
||||
|
||||
pub(super) const DBUS_TIMEOUT: Duration = Duration::from_millis(250);
|
||||
const GNOME_INPUT_SCHEMA: &str = "org.gnome.desktop.input-sources";
|
||||
const GNOME_DEFAULT_LAYOUT: &str = "us";
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(super) struct UnreliableSource(pub &'static str);
|
||||
|
||||
impl fmt::Display for UnreliableSource {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
formatter.write_str(self.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for UnreliableSource {}
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
pub(super) enum Source {
|
||||
Gnome(Names),
|
||||
Wayland { keymap: Vec<u8>, group: Option<u32> },
|
||||
Xwayland { keymap: Vec<u8>, group: Option<u32> },
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
pub(super) struct Names {
|
||||
pub model: CString,
|
||||
pub layout: CString,
|
||||
pub variant: CString,
|
||||
pub options: CString,
|
||||
}
|
||||
|
||||
impl Source {
|
||||
pub fn read() -> ResultType<Self> {
|
||||
let connection = Connection::new_session()?;
|
||||
if name_has_owner(&connection, "org.gnome.Shell")? {
|
||||
if let Some(names) = gnome_layout()? {
|
||||
return Ok(Self::Gnome(names));
|
||||
}
|
||||
return Ok(Self::Wayland {
|
||||
keymap: super::wayland::read_keymap()?,
|
||||
group: None,
|
||||
});
|
||||
}
|
||||
let kde_layouts = name_has_owner(&connection, "org.kde.keyboard")?;
|
||||
// KWin 5 does not publish the layout service for a single-layout map.
|
||||
if kde_layouts || name_has_owner(&connection, "org.kde.KWin")? {
|
||||
return Ok(Self::Wayland {
|
||||
keymap: super::wayland::read_keymap()?,
|
||||
group: if kde_layouts {
|
||||
Some(kde_layout_group(&connection)?)
|
||||
} else {
|
||||
None
|
||||
},
|
||||
});
|
||||
}
|
||||
// Other compositors need the effective keymap and active group of our
|
||||
// uinput device, including per-device options and custom keymap overrides.
|
||||
// wl_keyboard exposes a seat map that may belong to a physical keyboard.
|
||||
// Equal layout names/group indices do not prove map identity: Caps can
|
||||
// act as AltGr in one map and toggle CapsLock in the other.
|
||||
//
|
||||
// Sway GET_INPUTS/GET_SEATS expose names and an index, not the device map.
|
||||
// GET_CONFIG returns saved config text, not effective runtime input
|
||||
// settings; parsing it cannot reliably account for runtime overrides.
|
||||
// Hyprland's devices reply reports RMLVO (rules/model/layout/variant/options),
|
||||
// but kb_file can override it. Those fields alone cannot reconstruct the
|
||||
// loaded map. This does not rule out additional compositor-specific APIs.
|
||||
//
|
||||
// Reliable native discovery needs a compositor query associating the
|
||||
// device's actual map (or verified effective configuration) with its group.
|
||||
// uinput supplies keycodes; it cannot report the compositor's XKB policy.
|
||||
// Xwayland remains best effort; see xwayland::read for its freshness limits.
|
||||
// zwp_virtual_keyboard_manager_v1 needs a separate injection backend and
|
||||
// is not universally supported; it does not query an existing uinput map.
|
||||
super::xwayland::read()
|
||||
}
|
||||
}
|
||||
|
||||
fn name_has_owner(connection: &Connection, name: &str) -> ResultType<bool> {
|
||||
let proxy = connection.with_proxy(
|
||||
"org.freedesktop.DBus",
|
||||
"/org/freedesktop/DBus",
|
||||
DBUS_TIMEOUT,
|
||||
);
|
||||
let (owned,): (bool,) = proxy.method_call("org.freedesktop.DBus", "NameHasOwner", (name,))?;
|
||||
Ok(owned)
|
||||
}
|
||||
|
||||
fn kde_layout_group(connection: &Connection) -> ResultType<u32> {
|
||||
let proxy = connection.with_proxy("org.kde.keyboard", "/Layouts", DBUS_TIMEOUT);
|
||||
let (group,): (u32,) = proxy.method_call("org.kde.KeyboardLayouts", "getLayout", ())?;
|
||||
Ok(group)
|
||||
}
|
||||
|
||||
fn gnome_layout() -> ResultType<Option<Names>> {
|
||||
let schemas = gio::SettingsSchemaSource::default()
|
||||
.ok_or_else(|| anyhow!("GSettings schemas are unavailable"))?;
|
||||
let schema = schemas
|
||||
.lookup(GNOME_INPUT_SCHEMA, true)
|
||||
.ok_or_else(|| anyhow!("GNOME input source schema is unavailable"))?;
|
||||
let settings = gio::Settings::new_full(&schema, gio::SettingsBackend::NONE, None);
|
||||
let sources: Vec<(String, String)> = required_setting(&settings, "sources")?;
|
||||
// Focus changes restore a window's source without persisting MRU. Mark it
|
||||
// unreliable so refresh also discards a previously accepted MRU mapping.
|
||||
if sources.len() > 1 && required_setting::<bool>(&settings, "per-window")? {
|
||||
return Err(UnreliableSource(
|
||||
"GNOME per-window input sources cannot be determined from persisted MRU",
|
||||
)
|
||||
.into());
|
||||
}
|
||||
let recent: Vec<(String, String)> = required_setting(&settings, "mru-sources")?;
|
||||
// GNOME initially selects the first configured source when MRU is empty.
|
||||
// The IBus reader verifies the active engine before accepting persisted MRU.
|
||||
let selected = recent
|
||||
.iter()
|
||||
.find(|source| sources.contains(source))
|
||||
.or(sources.first());
|
||||
let Some((layout, variant)) = gnome_source_layout(selected)? else {
|
||||
// IBus engines without an XKB override use the compositor's keymap.
|
||||
return Ok(None);
|
||||
};
|
||||
if layout.is_empty() {
|
||||
bail!("GNOME input source has an empty layout");
|
||||
}
|
||||
// Match GNOME Shell's session-wide options; it does not merge IBus
|
||||
// engine layout-option metadata into the compositor keymap.
|
||||
let options: Vec<String> = required_setting(&settings, "xkb-options")?;
|
||||
// Older GNOME releases use the default model and have no xkb-model setting.
|
||||
let model: String = if schema.has_key("xkb-model") {
|
||||
required_setting(&settings, "xkb-model")?
|
||||
} else {
|
||||
String::new()
|
||||
};
|
||||
Ok(Some(Names {
|
||||
model: CString::new(model)?,
|
||||
layout: CString::new(layout)?,
|
||||
variant: CString::new(variant)?,
|
||||
options: CString::new(options.join(","))?,
|
||||
}))
|
||||
}
|
||||
|
||||
fn gnome_source_layout(
|
||||
selected: Option<&(String, String)>,
|
||||
) -> ResultType<Option<(String, String)>> {
|
||||
let Some((kind, id)) = selected else {
|
||||
// GNOME Shell selects this layout when no input source is configured.
|
||||
return Ok(Some((GNOME_DEFAULT_LAYOUT.to_owned(), String::new())));
|
||||
};
|
||||
match kind.as_str() {
|
||||
"xkb" => {
|
||||
let (layout, variant) = id.split_once('+').unwrap_or((id.as_str(), ""));
|
||||
Ok(Some((layout.to_owned(), variant.to_owned())))
|
||||
}
|
||||
"ibus" => ibus::layout(id),
|
||||
_ => bail!("Unsupported GNOME input source type: {}", kind),
|
||||
}
|
||||
}
|
||||
|
||||
fn required_setting<T: FromVariant>(settings: &gio::Settings, key: &str) -> ResultType<T> {
|
||||
if !settings
|
||||
.settings_schema()
|
||||
.is_some_and(|schema| schema.has_key(key))
|
||||
{
|
||||
bail!("Missing GNOME setting {}", key);
|
||||
}
|
||||
settings
|
||||
.value(key)
|
||||
.get()
|
||||
.ok_or_else(|| anyhow!("Invalid GNOME setting {}", key))
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
use dbus::{
|
||||
arg::{RefArg, Variant},
|
||||
blocking::{stdintf::org_freedesktop_dbus::Properties, Connection},
|
||||
channel::Channel,
|
||||
};
|
||||
use hbb_common::{anyhow::anyhow, bail, ResultType};
|
||||
use std::{env, fs, io::ErrorKind, path::PathBuf};
|
||||
|
||||
const IBUS_SERVICE: &str = "org.freedesktop.IBus";
|
||||
const IBUS_PATH: &str = "/org/freedesktop/IBus";
|
||||
// IBusEngineDesc serialization preserves these field positions for its clients.
|
||||
const ENGINE_TYPE_FIELD: usize = 0;
|
||||
const ENGINE_NAME_FIELD: usize = 2;
|
||||
const ENGINE_LAYOUT_FIELD: usize = 9;
|
||||
const ENGINE_VARIANT_FIELD: usize = 14;
|
||||
|
||||
pub(super) fn layout(id: &str) -> ResultType<Option<(String, String)>> {
|
||||
let connection = Connection::from(Channel::open_private(&address()?)?);
|
||||
let bus = connection.with_proxy(
|
||||
"org.freedesktop.DBus",
|
||||
"/org/freedesktop/DBus",
|
||||
super::DBUS_TIMEOUT,
|
||||
);
|
||||
let _: (String,) = bus.method_call("org.freedesktop.DBus", "Hello", ())?;
|
||||
let proxy = connection.with_proxy(IBUS_SERVICE, IBUS_PATH, super::DBUS_TIMEOUT);
|
||||
let engine: Variant<Box<dyn RefArg>> = proxy.get(IBUS_SERVICE, "GlobalEngine")?;
|
||||
let fields: Vec<_> = engine
|
||||
.0
|
||||
.as_iter()
|
||||
.ok_or_else(|| anyhow!("Invalid IBus engine description"))?
|
||||
.collect();
|
||||
if field(&fields, ENGINE_TYPE_FIELD)? != "IBusEngineDesc" {
|
||||
bail!("IBus returned an unexpected engine description");
|
||||
}
|
||||
// GNOME may suppress IBus for password entry without updating persisted MRU.
|
||||
// Its xkb:us::eng echo engine does not identify the compositor's layout.
|
||||
if field(&fields, ENGINE_NAME_FIELD)? != id {
|
||||
return Err(
|
||||
super::UnreliableSource("MRU-selected IBus engine is not currently active").into(),
|
||||
);
|
||||
}
|
||||
let layout = field(&fields, ENGINE_LAYOUT_FIELD)?;
|
||||
if layout.is_empty() || layout == "default" {
|
||||
return Ok(None);
|
||||
}
|
||||
let variant = field(&fields, ENGINE_VARIANT_FIELD)?;
|
||||
let variant = if variant == "default" { "" } else { variant };
|
||||
Ok(Some((layout.to_owned(), variant.to_owned())))
|
||||
}
|
||||
|
||||
fn field<'a>(fields: &[&'a dyn RefArg], index: usize) -> ResultType<&'a str> {
|
||||
fields
|
||||
.get(index)
|
||||
.and_then(|value| (*value).as_str())
|
||||
.ok_or_else(|| anyhow!("Invalid IBus engine field {}", index))
|
||||
}
|
||||
|
||||
fn address() -> ResultType<String> {
|
||||
if let Some(address) = env::var_os("IBUS_ADDRESS") {
|
||||
return address
|
||||
.into_string()
|
||||
.map_err(|_| anyhow!("Invalid IBus address"));
|
||||
}
|
||||
let settings = fs::read_to_string(address_file()?)?;
|
||||
settings
|
||||
.lines()
|
||||
.find_map(|line| line.strip_prefix("IBUS_ADDRESS="))
|
||||
.map(str::to_owned)
|
||||
.ok_or_else(|| anyhow!("IBus address file contains no address"))
|
||||
}
|
||||
|
||||
fn address_file() -> ResultType<PathBuf> {
|
||||
if let Some(path) = env::var_os("IBUS_ADDRESS_FILE") {
|
||||
return Ok(path.into());
|
||||
}
|
||||
let machine = match fs::read_to_string("/var/lib/dbus/machine-id") {
|
||||
Err(error) if error.kind() == ErrorKind::NotFound => fs::read_to_string("/etc/machine-id")?,
|
||||
result => result?,
|
||||
};
|
||||
let display = env::var("WAYLAND_DISPLAY")?;
|
||||
Ok(gtk::glib::user_config_dir().join("ibus/bus").join(format!(
|
||||
"{}-unix-{}",
|
||||
machine.trim(),
|
||||
display
|
||||
)))
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
use hbb_common::{anyhow::anyhow, bail, libc, ResultType};
|
||||
use std::{
|
||||
ffi::CStr,
|
||||
fs::File,
|
||||
io,
|
||||
os::{
|
||||
fd::{AsRawFd, OwnedFd, RawFd},
|
||||
unix::fs::FileExt,
|
||||
},
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
use wayland_client::{
|
||||
protocol::{wl_keyboard, wl_registry, wl_seat},
|
||||
Connection, Dispatch, QueueHandle, WEnum,
|
||||
};
|
||||
|
||||
const KEYMAP_TIMEOUT: Duration = Duration::from_secs(1);
|
||||
const SEAT_VERSION: u32 = 7;
|
||||
|
||||
#[derive(Default)]
|
||||
struct KeyboardState {
|
||||
seat_bound: bool,
|
||||
keymap: Option<ResultType<Vec<u8>>>,
|
||||
}
|
||||
|
||||
pub(super) fn read_keymap() -> ResultType<Vec<u8>> {
|
||||
let connection = Connection::connect_to_env()?;
|
||||
let mut queue = connection.new_event_queue();
|
||||
connection.display().get_registry(&queue.handle(), ());
|
||||
let mut state = KeyboardState::default();
|
||||
let deadline = Instant::now() + KEYMAP_TIMEOUT;
|
||||
loop {
|
||||
queue.dispatch_pending(&mut state)?;
|
||||
if let Some(keymap) = state.keymap.take() {
|
||||
return keymap;
|
||||
}
|
||||
if Instant::now() >= deadline {
|
||||
bail!("Timed out reading the Wayland keyboard map");
|
||||
}
|
||||
queue.flush()?;
|
||||
if let Some(reader) = queue.prepare_read() {
|
||||
wait_for_read(reader.connection_fd().as_raw_fd(), deadline)?;
|
||||
reader.read()?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn wait_for_read(fd: RawFd, deadline: Instant) -> ResultType<()> {
|
||||
let mut descriptor = libc::pollfd {
|
||||
fd,
|
||||
events: libc::POLLIN,
|
||||
revents: 0,
|
||||
};
|
||||
loop {
|
||||
let remaining = deadline.saturating_duration_since(Instant::now());
|
||||
let timeout = i32::try_from(remaining.as_millis())?;
|
||||
let ready = unsafe { libc::poll(&mut descriptor, 1, timeout) };
|
||||
if ready < 0 {
|
||||
let error = io::Error::last_os_error();
|
||||
if error.kind() == io::ErrorKind::Interrupted {
|
||||
continue;
|
||||
}
|
||||
return Err(error.into());
|
||||
}
|
||||
if ready == 0 {
|
||||
bail!("Timed out reading the Wayland keyboard map");
|
||||
}
|
||||
if descriptor.revents & libc::POLLIN == 0 {
|
||||
bail!("Wayland keyboard connection closed: {}", descriptor.revents);
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
fn read_keymap_file(fd: OwnedFd, size: u32) -> ResultType<Vec<u8>> {
|
||||
let file = File::from(fd);
|
||||
if file.metadata()?.len() < u64::from(size) {
|
||||
bail!("Wayland keyboard map is shorter than its advertised size");
|
||||
}
|
||||
let mut bytes = vec![0; usize::try_from(size)?];
|
||||
// Compositors can share this file description with other clients.
|
||||
file.read_exact_at(&mut bytes, 0)?;
|
||||
CStr::from_bytes_with_nul(&bytes)?;
|
||||
Ok(bytes)
|
||||
}
|
||||
|
||||
impl Dispatch<wl_registry::WlRegistry, ()> for KeyboardState {
|
||||
fn event(
|
||||
state: &mut Self,
|
||||
registry: &wl_registry::WlRegistry,
|
||||
event: wl_registry::Event,
|
||||
_: &(),
|
||||
_: &Connection,
|
||||
handle: &QueueHandle<Self>,
|
||||
) {
|
||||
if let wl_registry::Event::Global {
|
||||
name,
|
||||
interface,
|
||||
version,
|
||||
} = event
|
||||
{
|
||||
// Multi-seat sessions are unsupported: neither registry order nor
|
||||
// keyboard capability identifies the seat receiving our uinput events.
|
||||
// The first seat may have no keyboard or expose an unrelated keymap.
|
||||
if interface == "wl_seat" && !state.seat_bound {
|
||||
registry.bind::<wl_seat::WlSeat, _, _>(name, version.min(SEAT_VERSION), handle, ());
|
||||
state.seat_bound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Dispatch<wl_seat::WlSeat, ()> for KeyboardState {
|
||||
fn event(
|
||||
_: &mut Self,
|
||||
seat: &wl_seat::WlSeat,
|
||||
event: wl_seat::Event,
|
||||
_: &(),
|
||||
_: &Connection,
|
||||
handle: &QueueHandle<Self>,
|
||||
) {
|
||||
if let wl_seat::Event::Capabilities {
|
||||
capabilities: WEnum::Value(capabilities),
|
||||
} = event
|
||||
{
|
||||
if capabilities.contains(wl_seat::Capability::Keyboard) {
|
||||
seat.get_keyboard(handle, ());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Dispatch<wl_keyboard::WlKeyboard, ()> for KeyboardState {
|
||||
fn event(
|
||||
state: &mut Self,
|
||||
_: &wl_keyboard::WlKeyboard,
|
||||
event: wl_keyboard::Event,
|
||||
_: &(),
|
||||
_: &Connection,
|
||||
_: &QueueHandle<Self>,
|
||||
) {
|
||||
if let wl_keyboard::Event::Keymap { format, fd, size } = event {
|
||||
state.keymap = Some(match format {
|
||||
WEnum::Value(wl_keyboard::KeymapFormat::XkbV1) => read_keymap_file(fd, size),
|
||||
_ => Err(anyhow!(
|
||||
"Wayland compositor did not provide an XKB keyboard map"
|
||||
)),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
use super::{source::Source, XkbKeymap, DEFAULT_GROUP};
|
||||
use hbb_common::{anyhow::anyhow, bail, libc, libloading::Library, ResultType};
|
||||
use std::{
|
||||
ffi::{c_void, CStr, CString},
|
||||
ptr::NonNull,
|
||||
};
|
||||
use xkbcommon_dl::{self as xkb, x11};
|
||||
|
||||
struct Connection {
|
||||
pointer: NonNull<c_void>,
|
||||
disconnect: unsafe extern "C" fn(*mut c_void),
|
||||
_library: Library,
|
||||
}
|
||||
|
||||
impl Connection {
|
||||
fn open() -> ResultType<Self> {
|
||||
let display = CString::new(std::env::var("DISPLAY")?)?;
|
||||
if display.as_bytes().is_empty() {
|
||||
bail!("Xwayland DISPLAY is empty");
|
||||
}
|
||||
if !display.as_bytes().starts_with(b":")
|
||||
&& !display.as_bytes().starts_with(b"unix:")
|
||||
&& !display.as_bytes().starts_with(b"unix/:")
|
||||
{
|
||||
bail!("Xwayland layout detection requires a local DISPLAY");
|
||||
}
|
||||
unsafe {
|
||||
let library = Library::new("libxcb.so.1")?;
|
||||
let connect = *library
|
||||
.get::<unsafe extern "C" fn(*const libc::c_char, *mut libc::c_int) -> *mut c_void>(
|
||||
b"xcb_connect\0",
|
||||
)?;
|
||||
let disconnect =
|
||||
*library.get::<unsafe extern "C" fn(*mut c_void)>(b"xcb_disconnect\0")?;
|
||||
let has_error = *library.get::<unsafe extern "C" fn(*mut c_void) -> libc::c_int>(
|
||||
b"xcb_connection_has_error\0",
|
||||
)?;
|
||||
let pointer = NonNull::new(connect(display.as_ptr(), std::ptr::null_mut()))
|
||||
.ok_or_else(|| anyhow!("Cannot create Xwayland connection"))?;
|
||||
let connection = Self {
|
||||
pointer,
|
||||
disconnect,
|
||||
_library: library,
|
||||
};
|
||||
let error = has_error(connection.pointer.as_ptr());
|
||||
if error != 0 {
|
||||
bail!("Cannot connect to Xwayland (XCB error {})", error);
|
||||
}
|
||||
Ok(connection)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Connection {
|
||||
fn drop(&mut self) {
|
||||
unsafe { (self.disconnect)(self.pointer.as_ptr()) };
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn read() -> ResultType<Source> {
|
||||
// Xwayland receives the group through focus-scoped wl_keyboard.modifiers.
|
||||
// With a native window focused, both core and slave X11 keyboards can
|
||||
// retain the last X11-focused group (verified on GNOME and KWin).
|
||||
// Reopening XCB or waiting cannot request the missing compositor update.
|
||||
// Prefer native GNOME/KDE sources; do not steal focus to refresh Xwayland.
|
||||
let api = xkb::xkbcommon_option().ok_or_else(|| anyhow!("Cannot load libxkbcommon"))?;
|
||||
let x11 = x11::xkbcommon_x11_option().ok_or_else(|| anyhow!("Cannot load libxkbcommon-x11"))?;
|
||||
let connection = Connection::open()?;
|
||||
let device = keyboard_device(x11, &connection)?;
|
||||
let keymap = read_keymap(x11, &connection, device)?;
|
||||
let state = unsafe {
|
||||
(x11.xkb_x11_state_new_from_device)(
|
||||
keymap.map.as_ptr(),
|
||||
connection.pointer.as_ptr(),
|
||||
device,
|
||||
)
|
||||
};
|
||||
let state =
|
||||
NonNull::new(state).ok_or_else(|| anyhow!("Cannot read Xwayland keyboard state"))?;
|
||||
let group = unsafe {
|
||||
(api.xkb_state_serialize_layout)(
|
||||
state.as_ptr(),
|
||||
xkb::xkb_state_component::XKB_STATE_LAYOUT_EFFECTIVE,
|
||||
)
|
||||
};
|
||||
unsafe { (api.xkb_state_unref)(state.as_ptr()) };
|
||||
let text = unsafe {
|
||||
(api.xkb_keymap_get_as_string)(
|
||||
keymap.map.as_ptr(),
|
||||
xkb::xkb_keymap_format::XKB_KEYMAP_FORMAT_TEXT_V1,
|
||||
)
|
||||
};
|
||||
let text = NonNull::new(text.cast_mut())
|
||||
.ok_or_else(|| anyhow!("Cannot serialize Xwayland keyboard map"))?;
|
||||
let bytes = unsafe { CStr::from_ptr(text.as_ptr()).to_bytes_with_nul().to_vec() };
|
||||
unsafe { libc::free(text.as_ptr().cast()) };
|
||||
Ok(Source::Xwayland {
|
||||
keymap: bytes,
|
||||
group: Some(group),
|
||||
})
|
||||
}
|
||||
|
||||
fn read_keymap(
|
||||
x11: &x11::XkbCommonX11,
|
||||
connection: &Connection,
|
||||
device: i32,
|
||||
) -> ResultType<XkbKeymap> {
|
||||
let api = xkb::xkbcommon_option().ok_or_else(|| anyhow!("Cannot load libxkbcommon"))?;
|
||||
let context =
|
||||
unsafe { (api.xkb_context_new)(xkb::xkb_context_flags::XKB_CONTEXT_NO_ENVIRONMENT_NAMES) };
|
||||
let context = NonNull::new(context).ok_or_else(|| anyhow!("Cannot create XKB context"))?;
|
||||
let map = unsafe {
|
||||
(x11.xkb_x11_keymap_new_from_device)(
|
||||
context.as_ptr(),
|
||||
connection.pointer.as_ptr(),
|
||||
device,
|
||||
xkb::xkb_keymap_compile_flags::XKB_KEYMAP_COMPILE_NO_FLAGS,
|
||||
)
|
||||
};
|
||||
unsafe { (api.xkb_context_unref)(context.as_ptr()) };
|
||||
let map = NonNull::new(map).ok_or_else(|| anyhow!("Cannot read Xwayland keyboard map"))?;
|
||||
Ok(XkbKeymap {
|
||||
api,
|
||||
map,
|
||||
group: DEFAULT_GROUP,
|
||||
})
|
||||
}
|
||||
|
||||
fn keyboard_device(api: &x11::XkbCommonX11, connection: &Connection) -> ResultType<i32> {
|
||||
let supported = unsafe {
|
||||
(api.xkb_x11_setup_xkb_extension)(
|
||||
connection.pointer.as_ptr(),
|
||||
x11::XKB_X11_MIN_MAJOR_XKB_VERSION,
|
||||
x11::XKB_X11_MIN_MINOR_XKB_VERSION,
|
||||
x11::xkb_x11_setup_xkb_extension_flags::XKB_X11_SETUP_XKB_EXTENSION_NO_FLAGS,
|
||||
std::ptr::null_mut(),
|
||||
std::ptr::null_mut(),
|
||||
std::ptr::null_mut(),
|
||||
std::ptr::null_mut(),
|
||||
)
|
||||
};
|
||||
if supported == 0 {
|
||||
bail!("Xwayland does not support the required XKB extension");
|
||||
}
|
||||
let device = unsafe { (api.xkb_x11_get_core_keyboard_device_id)(connection.pointer.as_ptr()) };
|
||||
if device < 0 {
|
||||
bail!("Xwayland has no core keyboard device");
|
||||
}
|
||||
Ok(device)
|
||||
}
|
||||
@@ -727,6 +727,8 @@ fn run(vs: VideoService) -> ResultType<()> {
|
||||
let repeat_encode_max = 10;
|
||||
let mut encode_fail_counter = 0;
|
||||
let mut first_frame = true;
|
||||
// Set once the encoder emits its first packet; until then it may legitimately return nothing.
|
||||
let mut encoder_warmed_up = false;
|
||||
let capture_width = c.width;
|
||||
let capture_height = c.height;
|
||||
let (mut second_instant, mut send_counter) = (Instant::now(), 0);
|
||||
@@ -743,7 +745,12 @@ fn run(vs: VideoService) -> ResultType<()> {
|
||||
&mut second_instant,
|
||||
&sp.name(),
|
||||
)?;
|
||||
if sp.is_option_true(OPTION_REFRESH) {
|
||||
// On macOS, a refresh here would destroy a hardware encoder that has been fed a frame but
|
||||
// not yet produced its first packet, restarting the warm-up forever. Defer until it has;
|
||||
// one that never does is still switched away from by max_fail_times in handle_one_frame.
|
||||
if sp.is_option_true(OPTION_REFRESH)
|
||||
&& refresh_allowed(first_frame, encoder_warmed_up, encoder.latency_free())
|
||||
{
|
||||
if vs.source.is_monitor() {
|
||||
let _ = try_broadcast_display_changed(&sp, display_idx, &c, true);
|
||||
}
|
||||
@@ -857,6 +864,7 @@ fn run(vs: VideoService) -> ResultType<()> {
|
||||
recorder.clone(),
|
||||
&mut encode_fail_counter,
|
||||
&mut first_frame,
|
||||
&mut encoder_warmed_up,
|
||||
capture_width,
|
||||
capture_height,
|
||||
)?;
|
||||
@@ -921,6 +929,7 @@ fn run(vs: VideoService) -> ResultType<()> {
|
||||
recorder.clone(),
|
||||
&mut encode_fail_counter,
|
||||
&mut first_frame,
|
||||
&mut encoder_warmed_up,
|
||||
capture_width,
|
||||
capture_height,
|
||||
)?;
|
||||
@@ -1233,6 +1242,12 @@ fn check_privacy_mode_changed(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn refresh_allowed(unfed: bool, warmed_up: bool, latency_free: bool) -> bool {
|
||||
// Only VideoToolbox has been seen to need this; other platforms keep refreshing as before.
|
||||
!cfg!(target_os = "macos") || unfed || warmed_up || latency_free
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn handle_one_frame(
|
||||
display: usize,
|
||||
@@ -1243,6 +1258,7 @@ fn handle_one_frame(
|
||||
recorder: Arc<Mutex<Option<Recorder>>>,
|
||||
encode_fail_counter: &mut usize,
|
||||
first_frame: &mut bool,
|
||||
encoder_warmed_up: &mut bool,
|
||||
width: usize,
|
||||
height: usize,
|
||||
) -> ResultType<HashSet<i32>> {
|
||||
@@ -1261,6 +1277,7 @@ fn handle_one_frame(
|
||||
match encoder.encode_to_message(frame, ms) {
|
||||
Ok(mut vf) => {
|
||||
*encode_fail_counter = 0;
|
||||
*encoder_warmed_up = true;
|
||||
vf.display = display as _;
|
||||
let mut msg = Message::new();
|
||||
msg.set_video_frame(vf);
|
||||
@@ -1525,3 +1542,21 @@ fn handle_screenshot(screenshot: Screenshot, msg: String, w: usize, h: usize, da
|
||||
log::error!("Failed to send screenshot, {}", e);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::refresh_allowed;
|
||||
|
||||
#[test]
|
||||
fn refresh_waits_for_hw_encoder_warmup() {
|
||||
// Deferred on macOS only; everywhere else a refresh is always allowed.
|
||||
assert_eq!(
|
||||
refresh_allowed(false, false, false),
|
||||
!cfg!(target_os = "macos")
|
||||
);
|
||||
assert!(refresh_allowed(false, true, false));
|
||||
assert!(refresh_allowed(false, false, true));
|
||||
// Nothing fed yet: no warm-up to lose, and a refresh can restart a stalled capturer.
|
||||
assert!(refresh_allowed(true, false, false));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -724,9 +724,9 @@ pub(super) fn get_capturer_for_display(
|
||||
// render-node-absent seat or a convert failure on the unprivileged side) must NOT propagate out
|
||||
// and restart-loop this per-display video service. Instead fall THROUGH to PipeWire for just this
|
||||
// display; the other DRM outputs keep streaming over DRM.
|
||||
// The ONE gate that keeps the probing form on purpose: this runs on the plain video thread,
|
||||
// Like the login, this gate keeps the probing form on purpose: it runs on the video thread,
|
||||
// not an async executor, and it is the capture-build path, so a definitive verdict is worth
|
||||
// seconds here. It is also what makes a cold cache recoverable at all -- warm_availability
|
||||
// seconds here. With the login it is what makes a cold cache recoverable -- warm_availability
|
||||
// gives up after its attempts, so if EVERY gate were cache-only a --server that started
|
||||
// before the root service would never see DRM again for the rest of its life.
|
||||
#[cfg(feature = "drm")]
|
||||
|
||||
@@ -1832,7 +1832,7 @@ impl<T: InvokeUiSession> Interface for Session<T> {
|
||||
self.try_change_init_resolution(pi.current_display);
|
||||
let p = self.lc.read().unwrap().should_auto_login();
|
||||
if !p.is_empty() {
|
||||
input_os_password(p, true, self.clone());
|
||||
crate::client::auto_login(p, &pi, self.clone());
|
||||
}
|
||||
}
|
||||
let current = &pi.displays[pi.current_display as usize];
|
||||
|
||||
Reference in New Issue
Block a user