mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-03 03:19:27 +08:00
shared memory size use the max resolution of all displays (#8534)
The case of setting a monitor inserted later as the primary monitor is not taken into account Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
4b6ba7938f
commit
5114a9d369
@ -3150,6 +3150,7 @@ impl Connection {
|
|||||||
.map(|t| t.0 = Instant::now());
|
.map(|t| t.0 = Instant::now());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "hwcodec")]
|
||||||
fn update_supported_encoding(&mut self) {
|
fn update_supported_encoding(&mut self) {
|
||||||
let Some(last) = &self.last_supported_encoding else {
|
let Some(last) = &self.last_supported_encoding else {
|
||||||
return;
|
return;
|
||||||
|
@ -549,11 +549,15 @@ pub mod client {
|
|||||||
let mut max_pixel = 0;
|
let mut max_pixel = 0;
|
||||||
let align = 64;
|
let align = 64;
|
||||||
for d in displays {
|
for d in displays {
|
||||||
let pixel = utils::align(d.width(), align) * utils::align(d.height(), align);
|
let resolutions = crate::platform::resolutions(&d.name());
|
||||||
|
for r in resolutions {
|
||||||
|
let pixel =
|
||||||
|
utils::align(r.width as _, align) * utils::align(r.height as _, align);
|
||||||
if max_pixel < pixel {
|
if max_pixel < pixel {
|
||||||
max_pixel = pixel;
|
max_pixel = pixel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
let shmem_size = utils::align(ADDR_CAPTURE_FRAME + max_pixel * 4, align);
|
let shmem_size = utils::align(ADDR_CAPTURE_FRAME + max_pixel * 4, align);
|
||||||
// os error 112, no enough space
|
// os error 112, no enough space
|
||||||
*SHMEM.lock().unwrap() = Some(crate::portable_service::SharedMemory::create(
|
*SHMEM.lock().unwrap() = Some(crate::portable_service::SharedMemory::create(
|
||||||
|
Loading…
Reference in New Issue
Block a user