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