input-capture: Check barriers don't extend into nonexisting monitors

Create a fake monitor region right of the right-most monitor and if a
horizontal barrier extends into that region, fail the barrier. Barriers
are aligned on the top/left edge of the pixel so the most natural
barrier of (e.g. 0-1024) is also wrong - it's one pixel into the next
monitor.

Check this for nonexisting screens on the right too to avoid clients
suddenly failing when multiple monitors are present.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3319>
This commit is contained in:
Peter Hutterer
2023-10-23 15:41:48 +10:00
committed by Marge Bot
parent b7078ddab7
commit 85885c6539
2 changed files with 29 additions and 2 deletions

View File

@ -702,8 +702,8 @@ test_barriers (void)
* +==============+
*/
barrier1 = input_capture_session_add_barrier (session, 0, 0, 0, 600);
barrier2 = input_capture_session_add_barrier (session, 800, 768, 1824, 768);
barrier3 = input_capture_session_add_barrier (session, 800, 0, 1824, 0);
barrier2 = input_capture_session_add_barrier (session, 800, 768, 1823, 768);
barrier3 = input_capture_session_add_barrier (session, 800, 0, 1823, 0);
g_assert_cmpuint (barrier1, !=, 0);
g_assert_cmpuint (barrier2, !=, 0);