-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable retina scale factor #7269
Conversation
src/server/connection.rs
Outdated
#[cfg(target_os = "macos")] | ||
Some(message::Union::CursorPosition(pos)) => { | ||
if let Some(msg) = conn.retina.on_cursor_pos(&pos, conn.display_idx) { | ||
sent = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not rewrite msg here.
msg = new_msg
video_service_count += 1; | ||
} | ||
} | ||
*scrap::quartz::ENABLE_RETINA.lock().unwrap() = video_service_count < 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the first one can be retina, then following subscription will be not-retina. If so, there is still issue for multiple window/display case, because the first display is retina, the other displays are not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another worse case, the capture uses retina, but the subscriber's displays info shows non-retina.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scrap::quartz::ENABLE_RETINA
is a global control and is used when querying the display size in display service in a loop , so "use retina as retina" or all non-retina.
A display is retina when BackingScaleFactor > 1.0 and ENABLE_RETINA is true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not put here, you should put in connection.rs. because multiple connections with one subscription for each connection should still can use retina.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
video_service_count is the number of video services with subscriber, or captured screen count. When multiple connections are connected to the same screen, they will share the same video service, and count is 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about one subscribe to display 1, another one subscribe to display 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can ignore this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about one subscribe to display 1, another one subscribe to display 2?
For this, retina is fine. But we can ignore this case.
I did not see you test multiple windows. |
Updated to the above, but found another problem. video_service_count can be 0 when there is a connection. It may be a sequence problem. I will find the reason. (Because |
src/server/connection.rs
Outdated
@@ -629,7 +633,7 @@ impl Connection { | |||
}, | |||
Some((instant, value)) = rx.recv() => { | |||
let latency = instant.elapsed().as_millis() as i64; | |||
let msg: &Message = &value; | |||
let mut msg= value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
format
faead91
to
3fb3237
Compare
} | ||
None | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add #[inline] for above 3 functions
* enabled only when there are only one video service running * scale mouse event * scale cursor position * scale remote menu display button * adjust resolution Signed-off-by: 21pages <pages21@163.com>
* enable retina scale factor * enabled only when there are only one video service running * scale mouse event * scale cursor position * scale remote menu display button * adjust resolution Signed-off-by: 21pages <pages21@163.com> * Update server.rs --------- Signed-off-by: 21pages <pages21@163.com> Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
#6980 #5246
rustdesk_Y7s7nqxHiM.mp4
multi window:
rustdesk_qiOAhTgRTx.mp4
Old version control mac retina screen
![rustdesk_JrsBXWCcIA](https://private-user-images.githubusercontent.com/14891774/308060466-eb554a8d-bacb-41db-82f1-636950a1abf7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk1NjU3NjQsIm5iZiI6MTcxOTU2NTQ2NCwicGF0aCI6Ii8xNDg5MTc3NC8zMDgwNjA0NjYtZWI1NTRhOGQtYmFjYi00MWRiLTgyZjEtNjM2OTUwYTFhYmY3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI4VDA5MDQyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg1ZTVmMWNjYTRlYjlhNWYyOTI2MzA1ZjQ5NTA5MjU4MjgzZjNjNDA4ZDVhYmE0Y2IwNmNlY2M2NjcxMDIzMjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.SDBRcLqneZ9a0ku9DxPp9awgzd6u6iKXEtIAGqZbx0E)