pygame-ce
pygame-ce copied to clipboard
Add `Window.handle`
trafficstars
Window manager information and especially the window handle were only accessible to the display module. I feel like you should know the window handle of any window, so I added the property. This PR changed so now only the window handle is returned. Check the comments ( especially this comment ) for more.
Summary by CodeRabbit
-
New Features
- Added Window.handle read-only property returning the platform window handle as an integer when available, otherwise 0. Available on Windows, X11, Cocoa, UIKit, Android and Vivante; not supported on Wayland and some others. Marked versionadded 2.5.7.
-
Documentation
- Added docs describing the handle property's behavior and platform availability.
-
Tests
- Added a test asserting Window.handle exists and is an int.