Skip to content

Commit c00ff29

Browse files
committed
Deprecate Window foreign kwarg
1 parent f78f937 commit c00ff29

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docs/reST/ref/window.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
:param bool keyboard_grabbed: Create a window with grabbed keyboard input.
3838
:param bool input_focus: Create a window with input focus.
3939
:param bool mouse_focus: Create a window with mouse focus.
40-
:param bool foreign: Marks a window not created by SDL.
4140
:param bool allow_high_dpi: Create a window in high-DPI mode if supported.
4241
:param bool mouse_capture: Create a window that has the mouse captured
4342
(unrelated to INPUT_GRABBED).

src_c/window.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,12 @@ window_init(pgWindowObject *self, PyObject *args, PyObject *kwargs)
923923
}
924924
}
925925
else if (!strcmp(_key_str, "foreign")) {
926+
if (PyErr_WarnEx(PyExc_DeprecationWarning,
927+
"The foreign kwarg has been deprecated "
928+
"and may be removed in a future version",
929+
1) == -1) {
930+
return -1;
931+
}
926932
if (_value_bool) {
927933
flags |= SDL_WINDOW_FOREIGN;
928934
}

0 commit comments

Comments
 (0)