mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-30 17:19:03 +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());
|
||||
}
|
||||
|
||||
#[cfg(feature = "hwcodec")]
|
||||
fn update_supported_encoding(&mut self) {
|
||||
let Some(last) = &self.last_supported_encoding else {
|
||||
return;
|
||||
|
@ -549,9 +549,13 @@ pub mod client {
|
||||
let mut max_pixel = 0;
|
||||
let align = 64;
|
||||
for d in displays {
|
||||
let pixel = utils::align(d.width(), align) * utils::align(d.height(), align);
|
||||
if max_pixel < pixel {
|
||||
max_pixel = pixel;
|
||||
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 {
|
||||
max_pixel = pixel;
|
||||
}
|
||||
}
|
||||
}
|
||||
let shmem_size = utils::align(ADDR_CAPTURE_FRAME + max_pixel * 4, align);
|
||||
|
Loading…
Reference in New Issue
Block a user