|
1 | | -from typing import Any, TYPE_CHECKING |
| 1 | +from typing import Any |
2 | 2 |
|
3 | | -from ..base import MSSBase |
4 | | -from ..exception import ScreenShotError |
5 | | -from ..models import Monitor |
6 | | -from ..screenshot import ScreenShot |
| 3 | +from mss.base import MSSBase |
| 4 | +from mss.exception import ScreenShotError |
| 5 | +from mss.models import Monitor |
| 6 | +from mss.screenshot import ScreenShot |
7 | 7 |
|
8 | 8 | # FIXME: We can't currently import libxcb etc. straight from xcb, |
9 | 9 | # since it will update them when we call initialize, and we won't see |
10 | 10 | # the changes. I'm going to change initialize's API to address that. |
11 | 11 | from . import xcb |
12 | 12 | from .xcb import ( |
13 | | - initialize, |
| 13 | + XCB_IMAGE_FORMAT_Z_PIXMAP, |
| 14 | + XCB_RANDR_MAJOR_VERSION, |
| 15 | + XCB_RANDR_MINOR_VERSION, |
| 16 | + XCB_XFIXES_MAJOR_VERSION, |
| 17 | + XCB_XFIXES_MINOR_VERSION, |
14 | 18 | connect, |
15 | 19 | disconnect, |
16 | | - xcb_setup_roots, |
17 | | - xcb_randr_query_version, |
| 20 | + initialize, |
18 | 21 | xcb_get_geometry, |
19 | | - xcb_randr_get_screen_resources_current, |
20 | | - xcb_randr_get_screen_resources_current_crtcs, |
21 | | - xcb_randr_get_crtc_info, |
22 | 22 | xcb_get_image, |
23 | | - XCB_IMAGE_FORMAT_Z_PIXMAP, |
24 | 23 | xcb_get_image_data, |
25 | | - xcb_xfixes_query_version, |
| 24 | + xcb_randr_get_crtc_info, |
| 25 | + xcb_randr_get_screen_resources, |
| 26 | + xcb_randr_get_screen_resources_crtcs, |
| 27 | + xcb_randr_get_screen_resources_current, |
| 28 | + xcb_randr_get_screen_resources_current_crtcs, |
| 29 | + xcb_randr_query_version, |
| 30 | + xcb_setup_roots, |
26 | 31 | xcb_xfixes_get_cursor_image, |
27 | 32 | xcb_xfixes_get_cursor_image_cursor_image, |
28 | | - XCB_RANDR_MAJOR_VERSION, |
29 | | - XCB_RANDR_MINOR_VERSION, |
30 | | - XCB_XFIXES_MAJOR_VERSION, |
31 | | - XCB_XFIXES_MINOR_VERSION, |
| 33 | + xcb_xfixes_query_version, |
32 | 34 | ) |
33 | 35 |
|
34 | | - |
35 | 36 | SUPPORTED_DEPTHS = {24, 32} |
36 | 37 | SUPPORTED_BYTES_PER_PIXEL = 32 |
37 | 38 | ALL_PLANES = 0xFFFFFFFF # XCB doesn't define AllPlanes |
@@ -183,10 +184,7 @@ def _cursor_impl_check_xfixes(self) -> bool: |
183 | 184 | # We can work with 2.0 and later, but not sure about the |
184 | 185 | # actual minimum version we can use. That's ok; everything |
185 | 186 | # these days is much more modern. |
186 | | - if (reply.major_version, reply.minor_version) < (2, 0): |
187 | | - return False |
188 | | - |
189 | | - return True |
| 187 | + return not (reply.major_version, reply.minor_version) < (2, 0) |
190 | 188 |
|
191 | 189 | def _cursor_impl(self) -> ScreenShot: |
192 | 190 | """Retrieve all cursor data. Pixels have to be RGBx.""" |
|
0 commit comments