mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
Start capturing screen when connection established
This commit is contained in:
@@ -225,11 +225,10 @@ int MainWindow::Run() {
|
||||
}
|
||||
});
|
||||
|
||||
if (0 == screen_capturer_init_ret) {
|
||||
screen_capturer_->Start();
|
||||
} else {
|
||||
if (0 != screen_capturer_init_ret) {
|
||||
screen_capturer_->Destroy();
|
||||
screen_capturer_ = nullptr;
|
||||
LOG_ERROR("Create screen capturer failed");
|
||||
}
|
||||
|
||||
// Mouse control
|
||||
|
||||
@@ -153,12 +153,14 @@ void MainWindow::OnConnectionStatusCb(ConnectionStatus status,
|
||||
} else if (ConnectionStatus::Connected == status) {
|
||||
main_window->connection_status_str_ = "Connected";
|
||||
main_window->connection_established_ = true;
|
||||
main_window->screen_capturer_->Start();
|
||||
} else if (ConnectionStatus::Disconnected == status) {
|
||||
main_window->connection_status_str_ = "Disconnected";
|
||||
} else if (ConnectionStatus::Failed == status) {
|
||||
main_window->connection_status_str_ = "Failed";
|
||||
} else if (ConnectionStatus::Closed == status) {
|
||||
main_window->connection_status_str_ = "Closed";
|
||||
main_window->screen_capturer_->Stop();
|
||||
} else if (ConnectionStatus::IncorrectPassword == status) {
|
||||
main_window->connection_status_str_ = "Incorrect password";
|
||||
if (main_window->connect_button_pressed_) {
|
||||
|
||||
Reference in New Issue
Block a user