diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-07-22 04:56:50 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-07-22 04:56:50 +0200 |
commit | b898bddb63d1069562b0e45ddf8d87e18f456cdb (patch) | |
tree | f7e74dba618c92a7a72a24f482589409c3afd27d /src/capture/kms_cuda.c | |
parent | 4e8c47a154276aa58fa7d0a6568e165accc97eeb (diff) |
Hide cursor when it's on another display 2
Diffstat (limited to 'src/capture/kms_cuda.c')
-rw-r--r-- | src/capture/kms_cuda.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/capture/kms_cuda.c b/src/capture/kms_cuda.c index d74cbee..e6fa42f 100644 --- a/src/capture/kms_cuda.c +++ b/src/capture/kms_cuda.c @@ -234,12 +234,22 @@ static bool gsr_capture_kms_cuda_should_stop(gsr_capture *cap, bool *err) { return false; } +/* Prefer non combined planes */ static gsr_kms_response_fd* find_drm_by_connector_id(gsr_kms_response *kms_response, uint32_t connector_id) { + int index_combined = -1; for(int i = 0; i < kms_response->num_fds; ++i) { - if(kms_response->fds[i].connector_id == connector_id && !kms_response->fds[i].is_cursor) - return &kms_response->fds[i]; + if(kms_response->fds[i].connector_id == connector_id && !kms_response->fds[i].is_cursor) { + if(kms_response->fds[i].is_combined_plane) + index_combined = i; + else + return &kms_response->fds[i]; + } } - return NULL; + + if(index_combined != -1) + return &kms_response->fds[index_combined]; + else + return NULL; } static gsr_kms_response_fd* find_first_combined_drm(gsr_kms_response *kms_response) { |