Skip to content

Commit 5114a9d

Browse files
authored
shared memory size use the max resolution of all displays (rustdesk#8534)
The case of setting a monitor inserted later as the primary monitor is not taken into account Signed-off-by: 21pages <[email protected]>
1 parent 4b6ba79 commit 5114a9d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/server/connection.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3150,6 +3150,7 @@ impl Connection {
31503150
.map(|t| t.0 = Instant::now());
31513151
}
31523152

3153+
#[cfg(feature = "hwcodec")]
31533154
fn update_supported_encoding(&mut self) {
31543155
let Some(last) = &self.last_supported_encoding else {
31553156
return;

src/server/portable_service.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,9 +549,13 @@ pub mod client {
549549
let mut max_pixel = 0;
550550
let align = 64;
551551
for d in displays {
552-
let pixel = utils::align(d.width(), align) * utils::align(d.height(), align);
553-
if max_pixel < pixel {
554-
max_pixel = pixel;
552+
let resolutions = crate::platform::resolutions(&d.name());
553+
for r in resolutions {
554+
let pixel =
555+
utils::align(r.width as _, align) * utils::align(r.height as _, align);
556+
if max_pixel < pixel {
557+
max_pixel = pixel;
558+
}
555559
}
556560
}
557561
let shmem_size = utils::align(ADDR_CAPTURE_FRAME + max_pixel * 4, align);

0 commit comments

Comments
 (0)