From 6ee2691cce42adc0f449f0b554460cee56354950 Mon Sep 17 00:00:00 2001 From: Eduardo Hopperdietzel Date: Thu, 27 Jun 2024 14:47:45 -0400 Subject: [PATCH 1/2] gbm-kms: Make cursor transitions across outputs smoother Keep hardware cursor planes visible on all outputs intersected by the cursor geometry instead of only its position --- src/platforms/gbm-kms/server/kms/cursor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platforms/gbm-kms/server/kms/cursor.cpp b/src/platforms/gbm-kms/server/kms/cursor.cpp index 405e1fb4d63..68a4ddc2701 100644 --- a/src/platforms/gbm-kms/server/kms/cursor.cpp +++ b/src/platforms/gbm-kms/server/kms/cursor.cpp @@ -347,12 +347,13 @@ void mgg::Cursor::place_cursor_at_locked( return; bool set_on_all_outputs = true; + auto const cursor_rect = geometry::Rectangle(position - hotspot, size); for_each_used_output([&](KMSOutput& output, DisplayConfigurationOutput const& conf) { auto const output_rect = conf.extents(); - if (output_rect.contains(position)) + if (output_rect.overlaps(cursor_rect)) { auto const orientation = conf.orientation; auto const relative_to_extants = position - output_rect.top_left; From ddb613cd2f5fb02afd9c8088515ef6bf4cc7a24c Mon Sep 17 00:00:00 2001 From: Eduardo Hopperdietzel Date: Fri, 28 Jun 2024 03:21:42 -0400 Subject: [PATCH 2/2] Update MesaCursorTest.move_to_moves_cursor_to_right_output --- tests/unit-tests/platforms/gbm-kms/kms/test_cursor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit-tests/platforms/gbm-kms/kms/test_cursor.cpp b/tests/unit-tests/platforms/gbm-kms/kms/test_cursor.cpp index 7ec7caabf50..fb06d329011 100644 --- a/tests/unit-tests/platforms/gbm-kms/kms/test_cursor.cpp +++ b/tests/unit-tests/platforms/gbm-kms/kms/test_cursor.cpp @@ -548,11 +548,11 @@ TEST_F(MesaCursorTest, move_to_moves_cursor_to_right_output) cursor.show(stub_image); - EXPECT_CALL(*output_container.outputs[0], move_cursor(geom::Point{10,10})); + EXPECT_CALL(*output_container.outputs[0], move_cursor(geom::Point{10,-4})); EXPECT_CALL(*output_container.outputs[1], move_cursor(_)) .Times(0); - cursor.move_to({10, 10}); + cursor.move_to({10, -4}); output_container.verify_and_clear_expectations(); @@ -576,7 +576,7 @@ TEST_F(MesaCursorTest, move_to_moves_cursor_to_right_output) EXPECT_CALL(*output_container.outputs[1], move_cursor(_)) .Times(0); - cursor.move_to({-1, -1}); + cursor.move_to({-64, -64}); output_container.verify_and_clear_expectations(); }