Skip to content

Commit

Permalink
Deprecate input_only argument
Browse files Browse the repository at this point in the history
  • Loading branch information
ankith26 committed Nov 22, 2024
1 parent c00ff29 commit fae899b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/reST/ref/window.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions src_c/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit fae899b

Please sign in to comment.