mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
[feat] enable window grab when mouse control enabled
This commit is contained in:
@@ -881,7 +881,7 @@ int Render::Run() {
|
||||
SDL_UpdateTexture(stream_texture_, NULL, dst_buffer_, texture_width_);
|
||||
} else {
|
||||
if (connection_established_) {
|
||||
ProcessMouseKeyEven(event);
|
||||
ProcessMouseKeyEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -889,6 +889,15 @@ int Render::Run() {
|
||||
if (connection_established_ && streaming_) {
|
||||
CreateStreamWindow();
|
||||
SetupStreamWindow();
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
DrawMainWindow();
|
||||
|
||||
Reference in New Issue
Block a user