aboutsummaryrefslogtreecommitdiff
path: root/src/capture/kms.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-11-08 23:57:59 +0100
committerdec05eba <dec05eba@protonmail.com>2024-11-08 23:57:59 +0100
commit76c565684f0bec0ac02062cba134abd0dd3ce1aa (patch)
tree02e2f14cc87ba6c22126d318f113920d351af4c2 /src/capture/kms.c
parent34c0edc99170e6c7d738342334e3d0f39cba845b (diff)
Prefer drm cursor over x11 on x11, to fix correct position and size when x11 output is scaled
Diffstat (limited to 'src/capture/kms.c')
-rw-r--r--src/capture/kms.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/capture/kms.c b/src/capture/kms.c
index 5292012..fd85134 100644
--- a/src/capture/kms.c
+++ b/src/capture/kms.c
@@ -636,11 +636,13 @@ static int gsr_capture_kms_capture(gsr_capture *cap, AVFrame *frame, gsr_color_c
gsr_kms_response_item *cursor_drm_fd = find_cursor_drm_if_on_monitor(self, drm_fd->connector_id, capture_is_combined_plane);
// The cursor is handled by x11 on x11 instead of using the cursor drm plane because on prime systems with a dedicated nvidia gpu
// the cursor plane is not available when the cursor is on the monitor controlled by the nvidia device.
- if(self->is_x11) {
+ // TODO: This doesn't work properly with software cursor on x11 since it will draw the x11 cursor on top of the cursor already in the framebuffer.
+ // Detect if software cursor is used on x11 somehow.
+ if(cursor_drm_fd) {
+ render_drm_cursor(self, color_conversion, cursor_drm_fd, target_pos, texture_rotation, output_size);
+ } else if(self->is_x11) {
const vec2i cursor_monitor_offset = self->capture_pos;
render_x11_cursor(self, color_conversion, cursor_monitor_offset, target_pos, output_size);
- } else if(cursor_drm_fd) {
- render_drm_cursor(self, color_conversion, cursor_drm_fd, target_pos, texture_rotation, output_size);
}
}