mirror of
				https://github.com/kunkundi/crossdesk.git
				synced 2025-10-26 20:25:34 +08:00 
			
		
		
		
	[fix] fix title bar display error when streaming
This commit is contained in:
		| @@ -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) { | ||||
|   | ||||
| @@ -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; | ||||
|             } | ||||
|             rejoin_ = false; | ||||
|           } else { | ||||
|             rejoin_ = true; | ||||
|   | ||||
| @@ -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; | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user