From fae899bd0cfaba14785550a1f855e9961cbfaad8 Mon Sep 17 00:00:00 2001 From: Ankith Date: Fri, 22 Nov 2024 22:56:17 +0530 Subject: [PATCH] Deprecate input_only argument --- docs/reST/ref/window.rst | 5 ++++- src_c/window.c | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/reST/ref/window.rst b/docs/reST/ref/window.rst index 9b18406a80..81352fee3c 100644 --- a/docs/reST/ref/window.rst +++ b/docs/reST/ref/window.rst @@ -403,7 +403,10 @@ :param bool input_only: if ``True``, the window will be given input focus but may be completely obscured by other windows. - Only supported on X11. + Only supported on X11. This has been deprecated and + may be removed in a future version. + + .. deprecated:: 2.5.3 ``input_only`` argument .. method:: restore diff --git a/src_c/window.c b/src_c/window.c index 727aa06d3b..5fe7ca90d2 100644 --- a/src_c/window.c +++ b/src_c/window.c @@ -289,6 +289,12 @@ window_focus(pgWindowObject *self, PyObject *args, PyObject *kwargs) return NULL; } if (input_only) { + if (PyErr_WarnEx(PyExc_DeprecationWarning, + "The input_only kwarg has been deprecated and may be " + "removed in a future version", + 1) == -1) { + return NULL; + } if (SDL_SetWindowInputFocus(self->_win)) { return RAISE(pgExc_SDLError, SDL_GetError()); }