From 530890f309042ac4901095b18eaddac264e4ee8e Mon Sep 17 00:00:00 2001 From: Greg Lucas Date: Thu, 28 Apr 2022 19:13:26 -0600 Subject: [PATCH] ENH: Add full-screen toggle to the macosx backend --- src/_macosx.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/_macosx.m b/src/_macosx.m index b0da1fb84f4d..3c33ec3fa2fb 100755 --- a/src/_macosx.m +++ b/src/_macosx.m @@ -684,6 +684,13 @@ static CGFloat _get_device_scale(CGContextRef cr) Py_RETURN_NONE; } +static PyObject* +FigureManager_full_screen_toggle(FigureManager* self) +{ + [self->window toggleFullScreen: nil]; + Py_RETURN_NONE; +} + static PyTypeObject FigureManagerType = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "_macosx.FigureManager", @@ -714,6 +721,9 @@ static CGFloat _get_device_scale(CGContextRef cr) {"resize", (PyCFunction)FigureManager_resize, METH_VARARGS}, + {"full_screen_toggle", + (PyCFunction)FigureManager_full_screen_toggle, + METH_NOARGS}, {} // sentinel }, };