Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5607c24

Browse files
committed
Add a comment to explain the purpose of this function.
1 parent 0df8646 commit 5607c24

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/_macosx.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6211,6 +6211,14 @@ static void timer_callback(CFRunLoopTimerRef timer, void* info)
62116211

62126212
static PyObject*
62136213
verify_main_display(PyObject* self)
6214+
/* Python2 contains a WMAvailable function in the MacOS module to check
6215+
* if python can interact with the display. This function calls
6216+
* CGMainDisplayID, which will return 0 if no window manager is available,
6217+
* or if we don't have permission to talk to it; this will happen if Python
6218+
* is not installed as a framework.
6219+
* The MacOS module was removed from Python3, so we need to provide a way
6220+
* to call CGMainDisplayID ourselves.
6221+
*/
62146222
{
62156223
PyObject* result;
62166224
CGDirectDisplayID display = CGMainDisplayID();

0 commit comments

Comments
 (0)