Skip to content

Commit ce87644

Browse files
committed
fix: ensure --with-cursor, and with_cursor argument & attribute, are simple NOOP on platforms not supporting the feature
1 parent 54c8c8b commit ce87644

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ History:
33
<see Git checking messages for history>
44

55
8.0.1 2023/xx/xx
6+
- MSS: ensure --with-cursor, and with_cursor argument & attribute, are simple NOOP on platforms not supporting the feature
67
- CLI: do not raise a ScreenShotError when -q, or --quiet, is used but return 1
78
- tests: fix test_entry_point() with multiple monitors having the same resolution
89

mss/base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@ def grab(self, monitor: Union[Monitor, Tuple[int, int, int, int]], /) -> ScreenS
8888

8989
with lock:
9090
screenshot = self._grab_impl(monitor)
91-
if self.with_cursor:
92-
cursor = self._cursor_impl()
93-
screenshot = self._merge(screenshot, cursor) # type: ignore[arg-type]
91+
if self.with_cursor and (cursor := self._cursor_impl()):
92+
return self._merge(screenshot, cursor)
9493
return screenshot
9594

9695
@property

0 commit comments

Comments
 (0)