diff --git a/src/gui/main_single_peer.cpp b/src/gui/main_single_peer.cpp index 796d694..b23c182 100644 --- a/src/gui/main_single_peer.cpp +++ b/src/gui/main_single_peer.cpp @@ -706,7 +706,8 @@ int main(int argc, char *argv[]) { std::string user_id = "C-" + mac_addr_str; ret = JoinConnection(peer_server, remote_id, client_password); if (0 == ret) { - // joined = true; + is_client_mode_ = true; + rejoin_ = false; } #if CHINESE_FONT } else if (strcmp(connect_label, u8"断开连接") == 0 && joined) { diff --git a/src/single_window/remote_peer_window.cpp b/src/single_window/remote_peer_window.cpp index 41e56c0..0f9e962 100644 --- a/src/single_window/remote_peer_window.cpp +++ b/src/single_window/remote_peer_window.cpp @@ -71,9 +71,7 @@ int Render::RemoteWindow() { ret = JoinConnection(peer_reserved_ ? peer_reserved_ : peer_, remote_id_, remote_password_.c_str()); if (0 == ret) { - if (peer_reserved_) { - is_client_mode_ = true; - } + is_client_mode_ = true; rejoin_ = false; } else { rejoin_ = true; diff --git a/src/single_window/render.cpp b/src/single_window/render.cpp index 5331fd8..a2d3d4d 100644 --- a/src/single_window/render.cpp +++ b/src/single_window/render.cpp @@ -501,22 +501,27 @@ int Render::Run() { &main_window_height_); int video_width = main_window_width_; - int video_height = main_window_height_ - title_bar_height_; + int video_height = main_window_height_ - + (fullscreen_button_pressed_ ? 0 : title_bar_height_); if (video_width * 9 < video_height * 16) { stream_render_rect_.x = 0; - stream_render_rect_.y = - abs(video_height - video_width * 9 / 16) / 2 + title_bar_height_; + stream_render_rect_.y = abs(video_height - video_width * 9 / 16) / 2 + + fullscreen_button_pressed_ + ? 0 + : title_bar_height_; stream_render_rect_.w = video_width; stream_render_rect_.h = video_width * 9 / 16; } else if (video_width * 9 > video_height * 16) { stream_render_rect_.x = abs(video_width - video_height * 16 / 9) / 2; - stream_render_rect_.y = title_bar_height_; + stream_render_rect_.y = + fullscreen_button_pressed_ ? 0 : title_bar_height_; stream_render_rect_.w = video_height * 16 / 9; stream_render_rect_.h = video_height; } else { stream_render_rect_.x = 0; - stream_render_rect_.y = title_bar_height_; + stream_render_rect_.y = + fullscreen_button_pressed_ ? 0 : title_bar_height_; stream_render_rect_.w = video_width; stream_render_rect_.h = video_height; }