Skip to content

Commit 5a33e8c

Browse files
committed
Small bug fixes to get the tests back to doing meaningful testing
1 parent fd91e62 commit 5a33e8c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/mss/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def __init__(
4040
self,
4141
/,
4242
*,
43+
backend: str = "default",
4344
compression_level: int = 6,
4445
with_cursor: bool = False,
4546
# Linux only
@@ -51,6 +52,11 @@ def __init__(
5152
self.compression_level = compression_level
5253
self.with_cursor = with_cursor
5354
self._monitors: Monitors = []
55+
# If there isn't a factory that removed the "backend" argument, make sure that it was set to "default".
56+
# Factories that do backend-specific dispatch should remove that argument.
57+
if backend != "default":
58+
msg = 'The only valid backend on this platform is "default".'
59+
raise ScreenShotError(msg)
5460

5561
def __enter__(self) -> MSSBase: # noqa:PYI034
5662
"""For the cool call `with MSS() as mss:`."""

src/mss/linux/xcb.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,10 @@ def xcb_setup_roots(r: XcbSetup) -> list[_Pointer]:
11791179
return list_xcb(libxcb.xcb_setup_roots_iterator, libxcb.xcb_screen_next, r)
11801180

11811181

1182+
def xcb_randr_get_screen_resources_crtcs(r: _Pointer) -> Array:
1183+
return array_xcb(randr.xcb_randr_get_screen_resources_crtcs, randr.xcb_randr_get_screen_resources_crtcs_length, r)
1184+
1185+
11821186
def xcb_randr_get_screen_resources_current_crtcs(r: _Pointer) -> Array:
11831187
return array_xcb(
11841188
randr.xcb_randr_get_screen_resources_current_crtcs, randr.xcb_randr_get_screen_resources_current_crtcs_length, r

0 commit comments

Comments
 (0)