mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
[fix] fix render resolution
This commit is contained in:
@@ -1034,6 +1034,7 @@ void Render::ProcessSdlEvent() {
|
||||
is_client_mode_ = false;
|
||||
reload_recent_connections_ = true;
|
||||
fullscreen_button_pressed_ = false;
|
||||
just_created_ = false;
|
||||
recent_connection_image_save_time_ = SDL_GetTicks();
|
||||
} else {
|
||||
LOG_INFO("Quit program");
|
||||
@@ -1048,16 +1049,16 @@ void Render::ProcessSdlEvent() {
|
||||
} else if (event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED &&
|
||||
stream_window_created_ &&
|
||||
event.window.windowID == SDL_GetWindowID(stream_window_)) {
|
||||
if (just_created_) {
|
||||
just_created_ = false;
|
||||
} else {
|
||||
for (auto& [_, props] : client_properties_) {
|
||||
if (!props->reset_control_bar_pos_) {
|
||||
props->mouse_diff_control_bar_pos_x_ = 0;
|
||||
props->mouse_diff_control_bar_pos_y_ = 0;
|
||||
}
|
||||
|
||||
if (!just_created_) {
|
||||
props->reset_control_bar_pos_ = true;
|
||||
}
|
||||
|
||||
int stream_window_width, stream_window_height;
|
||||
SDL_GetWindowSize(stream_window_, &stream_window_width,
|
||||
&stream_window_height);
|
||||
@@ -1066,8 +1067,7 @@ void Render::ProcessSdlEvent() {
|
||||
|
||||
float video_ratio = (float)props->original_display_width_ /
|
||||
(float)props->original_display_height_;
|
||||
float video_ratio_reverse =
|
||||
(float)props->original_display_height_ /
|
||||
float video_ratio_reverse = (float)props->original_display_height_ /
|
||||
(float)props->original_display_width_;
|
||||
|
||||
float render_area_width = stream_window_width_;
|
||||
@@ -1099,7 +1099,7 @@ void Render::ProcessSdlEvent() {
|
||||
(int)render_area_width, (int)render_area_height};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if (event.window.event == SDL_WINDOWEVENT_FOCUS_GAINED ||
|
||||
event.window.event == SDL_WINDOWEVENT_FOCUS_LOST) {
|
||||
bool focus_gained =
|
||||
|
||||
@@ -50,7 +50,6 @@ class Render {
|
||||
bool control_window_width_is_changing_ = false;
|
||||
bool control_window_height_is_changing_ = false;
|
||||
bool p2p_mode_ = true;
|
||||
bool hostname_sent_ = false;
|
||||
bool remember_password_ = false;
|
||||
char remote_password_[7] = "";
|
||||
float sub_stream_window_width_ = 1280;
|
||||
|
||||
@@ -357,9 +357,11 @@ void Render::OnConnectionStatusCb(ConnectionStatus status, const char *user_id,
|
||||
render->start_mouse_controller_ = false;
|
||||
render->start_keyboard_capturer_ = false;
|
||||
render->control_mouse_ = false;
|
||||
render->hostname_sent_ = false;
|
||||
render->original_display_width_ = 0;
|
||||
render->original_display_height_ = 0;
|
||||
props->connection_established_ = false;
|
||||
props->mouse_control_button_pressed_ = false;
|
||||
props->hostname_sent_ = false;
|
||||
if (render->audio_capture_) {
|
||||
render->StopSpeakerCapturer();
|
||||
render->audio_capture_ = false;
|
||||
|
||||
Reference in New Issue
Block a user