Skip to content

Latest commit

 

History

History
281 lines (207 loc) · 9.38 KB

File metadata and controls

281 lines (207 loc) · 9.38 KB

Technical Changes

10.2.0 (2026-xx-xx)

base.py

  • (This affected almost every file in some respect, but base.py was the most affected.) Introduced a new API, mss.MSS. This class can be used instead of the previous various MSSBase subclasses, so that the user can work with a consistent class regardless of implementation details. The methods implemented by MSSBase subclasses were renamed, and moved to MSSImplementation subclasses. The mss.MSS class now holds an MSSImplementation instance as an instance variable. (#486, #494)
  • Added primary_monitor property to return the primary monitor (or first monitor as fallback).

models.py

  • Changed Monitor type from dict[str, int] to dict[str, Any] to support new is_primary (bool, optional), name (str, optional), and unique_id (str, optional) fields.
  • Added TODO comment for future Monitor class implementation (#470).

windows.py

  • Added MONITORINFOEXW structure for extended monitor information.
  • Added DISPLAY_DEVICEW structure for device information.
  • Added constants: CCHDEVICENAME, MONITORINFOF_PRIMARY, EDD_GET_DEVICE_INTERFACE_NAME.
  • Added GetMonitorInfoW to CFUNCTIONS for querying monitor properties.
  • Added EnumDisplayDevicesW to CFUNCTIONS for querying device details.
  • Modified _monitors_impl() callback to extract primary monitor flag, device names, and device interface name (unique_id) using Win32 APIs; unique_id uses EDD_GET_DEVICE_INTERFACE_NAME when available.

linux/base.py

  • Reworked _monitors_impl() to prefer XRandR 1.5+ GetMonitors when available, falling back to enumerating active CRTCs.
  • Added monitor identification fields from RandR + EDID where available: is_primary, output, name, and unique_id.
  • Added EDID lookup via RandR EDID/EdidData output property and parsing via mss.tools.parse_edid().

linux/xcb.py

  • Added intern_atom() helper with per-connection caching and support for predefined atoms.
  • Added XCB_NONE constant (Atom(0)).
  • Added additional XRandR request wrappers used for monitor identification (GetMonitors, GetOutputInfo, GetOutputPrimary, GetOutputProperty).

linux/xcbhelpers.py

  • Added InternAtomReply structure and typed binding for xcb_intern_atom.
  • Added __eq__()/__hash__() to XID for value-based comparisons.

xcbproto/gen_xcb_to_py.py

  • Extended the generator to include additional XRandR requests used by the XCB backends (GetOutputInfo, GetOutputPrimary, GetOutputProperty, GetMonitors).
  • Updated typedef generation to emit value-based __eq__()/__hash__() implementations.
  • Refactored code generation helpers and formatting (use textwrap.indent/dedent).

tools.py

  • Added parse_edid() helper for extracting identifying fields (legacy model id, serial number, manufacture/model year, and display name) from EDID blocks.

linux/xshmgetimage.py

  • Fixed XID type handling for drawable/visual (avoid mixing raw .value with typed IDs).

10.1.1 (2025-xx-xx)

linux/init.py

  • Added an mss() factory to select between the different GNU/Linux backends.

linux/xlib.py

  • Moved the legacy Xlib backend into the mss.linux.xlib module to be used as a fallback implementation.

linux/xgetimage.py

  • Added an XCB-based backend that mirrors XGetImage semantics.

linux/xshmgetimage.py

  • Added an XCB backend powered by XShmGetImage with shm_status and shm_fallback_reason attributes for diagnostics.

10.1.0 (2025-08-16)

darwin.py

  • Added IMAGE_OPTIONS
  • Added kCGWindowImageBoundsIgnoreFraming
  • Added kCGWindowImageNominalResolution
  • Added kCGWindowImageShouldBeOpaque

10.0.0 (2024-11-14)

base.py

  • Added OPAQUE

darwin.py

  • Added MAC_VERSION_CATALINA

linux.py

  • Added BITS_PER_PIXELS_32
  • Added SUPPORTED_BITS_PER_PIXELS

9.0.0 (2023-04-18)

linux.py

  • Removed XEvent class. Use XErrorEvent instead.

windows.py

  • Added MSS.close() method
  • Removed MSS.bmp attribute
  • Removed MSS.memdc attribute

8.0.3 (2023-04-15)

linux.py

  • Added XErrorEvent class (old Event class is just an alias now, and will be removed in v9.0.0)

8.0.0 (2023-04-09)

base.py

  • Added compression_level=6 keyword argument to MSS.__init__()
  • Added display=None keyword argument to MSS.__init__()
  • Added max_displays=32 keyword argument to MSS.__init__()
  • Added with_cursor=False keyword argument to MSS.__init__()
  • Added MSS.with_cursor attribute

linux.py

  • Added MSS.close()
  • Moved MSS.__init__() keyword arguments handling to the base class
  • Renamed error_handler() function to _error_handler()
  • Renamed validate() function to __validate()
  • Renamed MSS.has_extension() method to _is_extension_enabled()
  • Removed ERROR namespace
  • Removed MSS.drawable attribute
  • Removed MSS.root attribute
  • Removed MSS.get_error_details() method. Use ScreenShotError.details attribute instead.

6.1.0 (2020-10-31)

darwin.py

  • Added CFUNCTIONS

linux.py

  • Added CFUNCTIONS

windows.py

  • Added CFUNCTIONS
  • Added MONITORNUMPROC
  • Removed MSS.monitorenumproc. Use MONITORNUMPROC instead.

6.0.0 (2020-06-30)

base.py

  • Added lock
  • Added MSS._grab_impl() (abstract method)
  • Added MSS._monitors_impl() (abstract method)
  • MSS.grab() is no more an abstract method
  • MSS.monitors is no more an abstract property

darwin.py

  • Renamed MSS.grab() to MSS._grab_impl()
  • Renamed MSS.monitors to MSS._monitors_impl()

linux.py

  • Added MSS.has_extension()
  • Removed MSS.display
  • Renamed MSS.grab() to MSS._grab_impl()
  • Renamed MSS.monitors to MSS._monitors_impl()

windows.py

  • Removed MSS._lock
  • Renamed MSS.srcdc_dict to MSS._srcdc_dict
  • Renamed MSS.grab() to MSS._grab_impl()
  • Renamed MSS.monitors to MSS._monitors_impl()

5.1.0 (2020-04-30)

base.py

  • Renamed back MSSMixin class to MSSBase
  • MSSBase is now derived from abc.ABCMeta
  • MSSBase.monitor is now an abstract property
  • MSSBase.grab() is now an abstract method

windows.py

  • Replaced MSS.srcdc with MSS.srcdc_dict

5.0.0 (2019-12-31)

darwin.py

  • Added MSS.__slots__

linux.py

  • Added MSS.__slots__
  • Deleted MSS.close()
  • Deleted LAST_ERROR constant. Use ERROR namespace instead, specially the ERROR.details attribute.

models.py

  • Added Monitor
  • Added Monitors
  • Added Pixel
  • Added Pixels
  • Added Pos
  • Added Size

screenshot.py

  • Added ScreenShot.__slots__
  • Removed Pos. Use models.Pos instead.
  • Removed Size. Use models.Size instead.

windows.py

  • Added MSS.__slots__
  • Deleted MSS.close()

4.0.1 (2019-01-26)

linux.py

  • Removed use of MSS.xlib.XDefaultScreen() 4.0.0 (2019-01-11)

base.py

  • Renamed MSSBase class to MSSMixin

linux.py

  • Renamed MSS.__del__() method to MSS.close()
  • Deleted MSS.last_error attribute. Use LAST_ERROR constant instead.
  • Added validate() function
  • Added MSS.get_error_details() method

windows.py

  • Renamed MSS.__exit__() method to MSS.close()

3.3.0 (2018-09-04)

exception.py

  • Added details attribute to ScreenShotError exception. Empty dict by default.

linux.py

  • Added error_handler() function

3.2.1 (2018-05-21)

windows.py

  • Removed MSS.scale_factor property
  • Removed MSS.scale() method

3.2.0 (2018-03-22)

base.py

  • Added MSSBase.compression_level attribute

linux.py

  • Added MSS.drawable attribute

screenshot.py

  • Added Screenshot.bgra attribute

tools.py

  • Changed signature of to_png(data, size, output=None) to to_png(data, size, level=6, output=None). level is the Zlib compression level.

3.1.2 (2018-01-05)

tools.py

  • Changed signature of to_png(data, size, output) to to_png(data, size, output=None). If output is None, the raw PNG bytes will be returned.

3.1.1 (2017-11-27)

__main__.py

  • Added args argument to main()

base.py

  • Moved ScreenShot class to screenshot.py

darwin.py

  • Added CGPoint.__repr__() function
  • Added CGRect.__repr__() function
  • Added CGSize.__repr__() function
  • Removed get_infinity() function

windows.py

  • Added MSS.scale() method
  • Added MSS.scale_factor property

3.0.0 (2017-07-06)

base.py

  • Added the ScreenShot class containing data for a given screenshot (support the Numpy array interface [ScreenShot.__array_interface__])
  • Added shot() method to MSSBase. It takes the same arguments as the save() method.
  • Renamed get_pixels to grab. It now returns a ScreenShot object.
  • Moved to_png method to tools.py. It is now a simple function.
  • Removed enum_display_monitors() method. Use monitors property instead.
  • Removed monitors attribute. Use monitors property instead.
  • Removed width attribute. Use ScreenShot.size[0] attribute or ScreenShot.width property instead.
  • Removed height attribute. Use ScreenShot.size[1] attribute or ScreenShot.height property instead.
  • Removed image. Use the ScreenShot.raw attribute or ScreenShot.rgb property instead.
  • Removed bgra_to_rgb() method. Use ScreenShot.rgb property instead.

darwin.py

  • Removed _crop_width() method. Screenshots are now using the width set by the OS (rounded to 16).

exception.py

  • Renamed ScreenshotError class to ScreenShotError

tools.py

  • Changed signature of to_png(data, monitor, output) to to_png(data, size, output) where size is a tuple(width, height)