mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
Only server can capture screen and control mouse
This commit is contained in:
@@ -499,6 +499,7 @@ int MainWindow::Run() {
|
||||
!connection_established_) {
|
||||
ret = JoinConnection(peer_, remote_id_, client_password_);
|
||||
if (0 == ret) {
|
||||
is_client_ = true;
|
||||
}
|
||||
|
||||
} else if (connect_button_label_ ==
|
||||
@@ -511,6 +512,7 @@ int MainWindow::Run() {
|
||||
is_create_connection_ = false;
|
||||
connection_established_ = false;
|
||||
received_frame_ = false;
|
||||
is_client_ = false;
|
||||
}
|
||||
|
||||
if (0 == ret) {
|
||||
@@ -842,6 +844,7 @@ int MainWindow::Run() {
|
||||
// Cleanup
|
||||
if (is_create_connection_) {
|
||||
LeaveConnection(peer_);
|
||||
is_client_ = false;
|
||||
}
|
||||
|
||||
if (peer_) {
|
||||
|
||||
@@ -98,6 +98,7 @@ class MainWindow {
|
||||
char input_password_[7] = "";
|
||||
char remote_id_[20] = "";
|
||||
char client_password_[20] = "";
|
||||
bool is_client_ = false;
|
||||
|
||||
private:
|
||||
int screen_width_ = 1280;
|
||||
|
||||
@@ -154,8 +154,10 @@ void MainWindow::OnConnectionStatusCb(ConnectionStatus status,
|
||||
} else if (ConnectionStatus::Connected == status) {
|
||||
main_window->connection_status_str_ = "Connected";
|
||||
main_window->connection_established_ = true;
|
||||
main_window->start_screen_capture_ = true;
|
||||
main_window->start_mouse_control_ = true;
|
||||
if (!main_window->is_client_) {
|
||||
main_window->start_screen_capture_ = true;
|
||||
main_window->start_mouse_control_ = true;
|
||||
}
|
||||
} else if (ConnectionStatus::Disconnected == status) {
|
||||
main_window->connection_status_str_ = "Disconnected";
|
||||
} else if (ConnectionStatus::Failed == status) {
|
||||
|
||||
Reference in New Issue
Block a user