diff --git a/src/device_controller/device_controller.h b/src/device_controller/device_controller.h index 0b1737a..d6eae3f 100644 --- a/src/device_controller/device_controller.h +++ b/src/device_controller/device_controller.h @@ -42,8 +42,8 @@ typedef struct { typedef struct { char host_name[64]; size_t host_name_size; - size_t origin_display_width; - size_t origin_display_height; + size_t original_display_width; + size_t original_display_height; } HostInfo; typedef struct { diff --git a/src/single_window/render.cpp b/src/single_window/render.cpp index 4ba2bf6..4764810 100644 --- a/src/single_window/render.cpp +++ b/src/single_window/render.cpp @@ -830,8 +830,10 @@ void Render::MainLoop() { remote_action.type = ControlType::host_infomation; memcpy(&remote_action.i.host_name, host_name.data(), host_name.size()); remote_action.i.host_name_size = host_name.size(); - remote_action.i.origin_display_width = screen_width_; - remote_action.i.origin_display_height = screen_height_; + remote_action.i.original_display_width = + screen_width_ * main_window_dpi_scaling_w_; + remote_action.i.original_display_height = + screen_height_ * main_window_dpi_scaling_h_; int ret = SendDataFrame(peer_, (const char*)&remote_action, sizeof(remote_action)); if (0 == ret) { diff --git a/src/single_window/render_callback_func.cpp b/src/single_window/render_callback_func.cpp index e3499ec..9345a7b 100644 --- a/src/single_window/render_callback_func.cpp +++ b/src/single_window/render_callback_func.cpp @@ -262,11 +262,11 @@ void Render::OnReceiveDataBufferCb(const char *data, size_t size, if (ControlType::host_infomation == remote_action.type) { props->remote_host_name_ = std::string(remote_action.i.host_name, remote_action.i.host_name_size); - props->original_display_width_ = remote_action.i.origin_display_width; - props->original_display_height_ = remote_action.i.origin_display_height; + props->original_display_width_ = remote_action.i.original_display_width; + props->original_display_height_ = remote_action.i.original_display_height; LOG_INFO("Remote hostname: [{}], resolution: [{}x{}]", - props->remote_host_name_, remote_action.i.origin_display_width, - remote_action.i.origin_display_height); + props->remote_host_name_, remote_action.i.original_display_width, + remote_action.i.original_display_height); } } else { if (ControlType::mouse == remote_action.type && render->mouse_controller_) {