mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 12:15:34 +08:00
[fix] fix stream window grabbing cannot be released after connection closed
This commit is contained in:
@@ -309,9 +309,7 @@ int Render::StartKeyboardCapturer() {
|
||||
},
|
||||
this);
|
||||
if (0 != keyboard_capturer_init_ret) {
|
||||
LOG_INFO("Destroy keyboard capturer")
|
||||
keyboard_capturer_->Unhook();
|
||||
keyboard_capturer_ = nullptr;
|
||||
LOG_ERROR("Start keyboard capturer failed");
|
||||
} else {
|
||||
LOG_INFO("Start keyboard capturer");
|
||||
}
|
||||
@@ -322,6 +320,7 @@ int Render::StartKeyboardCapturer() {
|
||||
int Render::StopKeyboardCapturer() {
|
||||
if (keyboard_capturer_) {
|
||||
keyboard_capturer_->Unhook();
|
||||
LOG_INFO("Stop keyboard capturer");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -857,6 +856,7 @@ int Render::Run() {
|
||||
if (event.type == SDL_QUIT) {
|
||||
if (streaming_) {
|
||||
LOG_INFO("Destroy stream window");
|
||||
SDL_SetWindowGrab(stream_window_, SDL_FALSE);
|
||||
DestroyStreamWindow();
|
||||
DestroyStreamWindowContext();
|
||||
|
||||
@@ -991,7 +991,6 @@ int Render::Run() {
|
||||
if (!stream_window_grabbed_ && control_mouse_) {
|
||||
SDL_SetWindowGrab(stream_window_, SDL_TRUE);
|
||||
stream_window_grabbed_ = true;
|
||||
LOG_INFO("Grabbing input events");
|
||||
} else if (stream_window_grabbed_ && !control_mouse_) {
|
||||
SDL_SetWindowGrab(stream_window_, SDL_FALSE);
|
||||
stream_window_grabbed_ = false;
|
||||
|
||||
@@ -302,13 +302,11 @@ void Render::OnConnectionStatusCb(ConnectionStatus status, const char *user_id,
|
||||
render->connection_status_str_ = "Closed";
|
||||
render->password_validating_time_ = 0;
|
||||
render->start_screen_capturer_ = false;
|
||||
render->mouse_controller_is_started_ = false;
|
||||
render->start_mouse_controller_ = false;
|
||||
render->mouse_controller_is_started_ = false;
|
||||
render->connection_established_ = false;
|
||||
render->control_mouse_ = false;
|
||||
render->mouse_control_button_pressed_ = false;
|
||||
render->start_keyboard_capturer_ = false;
|
||||
render->keyboard_capturer_is_started_ = false;
|
||||
render->hostname_sent_ = false;
|
||||
if (render->audio_capture_) {
|
||||
render->StopSpeakerCapturer();
|
||||
|
||||
Reference in New Issue
Block a user