Skip to content

Commit b9f80dc

Browse files
committed
Remove Window API that will be questionable in SDL3
1 parent a0acfb7 commit b9f80dc

File tree

4 files changed

+0
-45
lines changed

4 files changed

+0
-45
lines changed

buildconfig/stubs/pygame/window.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ class Window:
4545
@property
4646
def id(self) -> int: ...
4747
@property
48-
def display_index(self) -> int: ...
49-
@property
5048
def mouse_rect(self) -> Optional[Rect]: ...
5149
@mouse_rect.setter
5250
def mouse_rect(self, value: Optional[RectValue]) -> None: ...

docs/reST/ref/window.rst

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,6 @@
4444
(unrelated to INPUT_GRABBED).
4545
:param bool always_on_top: Create a window that is always on top
4646
(X11 only).
47-
:param bool skip_taskbar: Create a window that should not be added to the
48-
taskbar (X11 only).
49-
:param bool utility: Create a window that should be treated as a utility
50-
window (X11 only).
51-
:param bool tooltip: Create a window that should be treated as a tooltip
52-
(X11 only).
53-
:param bool popup_menu: Create a window that should be treated as a popup menu
54-
(X11 only).
55-
5647

5748
.. versionadded:: 2.4.0
5849

@@ -237,11 +228,6 @@
237228
| :sl:`Get or set the window opacity, between 0.0 (fully transparent) and 1.0 (fully opaque)`
238229
| :sg:`opacity -> float`
239230
240-
.. attribute:: display_index
241-
242-
| :sl:`Get the index of the display that owns the window (**read-only**)`
243-
| :sg:`get_display_index -> int`
244-
245231
.. classmethod:: from_display_module
246232

247233
| :sl:`Create a Window object using window data from display module`

src_c/doc/window_doc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#define DOC_WINDOW_MAXIMUMSIZE "maximum_size -> (int, int)\nGet or set the maximum size of the window's client area"
1616
#define DOC_WINDOW_POSITION "position -> (int, int) or WINDOWPOS_CENTERED or WINDOWPOS_UNDEFINED\nGet or set the window position in screen coordinates"
1717
#define DOC_WINDOW_OPACITY "opacity -> float\nGet or set the window opacity, between 0.0 (fully transparent) and 1.0 (fully opaque)"
18-
#define DOC_WINDOW_DISPLAYINDEX "get_display_index -> int\nGet the index of the display that owns the window (**read-only**)"
1918
#define DOC_WINDOW_FROMDISPLAYMODULE "from_display_module() -> Window\nCreate a Window object using window data from display module"
2019
#define DOC_WINDOW_GETSURFACE "get_surface() -> Surface\nGet the window surface"
2120
#define DOC_WINDOW_FLIP "flip() -> None\nUpdate the display surface to the window."

src_c/window.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -712,16 +712,6 @@ window_get_opacity(pgWindowObject *self, void *v)
712712
return PyFloat_FromDouble((double)opacity);
713713
}
714714

715-
static PyObject *
716-
window_get_display_index(pgWindowObject *self, PyObject *_null)
717-
{
718-
int index = SDL_GetWindowDisplayIndex(self->_win);
719-
if (index < 0) {
720-
return RAISE(pgExc_SDLError, SDL_GetError());
721-
}
722-
return PyLong_FromLong(index);
723-
}
724-
725715
static void
726716
window_dealloc(pgWindowObject *self, PyObject *_null)
727717
{
@@ -870,22 +860,6 @@ window_init(pgWindowObject *self, PyObject *args, PyObject *kwargs)
870860
if (_value_bool)
871861
flags |= SDL_WINDOW_ALWAYS_ON_TOP;
872862
}
873-
else if (!strcmp(_key_str, "skip_taskbar")) {
874-
if (_value_bool)
875-
flags |= SDL_WINDOW_SKIP_TASKBAR;
876-
}
877-
else if (!strcmp(_key_str, "utility")) {
878-
if (_value_bool)
879-
flags |= SDL_WINDOW_UTILITY;
880-
}
881-
else if (!strcmp(_key_str, "tooltip")) {
882-
if (_value_bool)
883-
flags |= SDL_WINDOW_TOOLTIP;
884-
}
885-
else if (!strcmp(_key_str, "popup_menu")) {
886-
if (_value_bool)
887-
flags |= SDL_WINDOW_POPUP_MENU;
888-
}
889863
else if (!strcmp(_key_str, "vulkan")) {
890864
if (_value_bool)
891865
flags |= SDL_WINDOW_VULKAN;
@@ -1076,8 +1050,6 @@ static PyGetSetDef _window_getset[] = {
10761050
DOC_WINDOW_POSITION, NULL},
10771051
{"opacity", (getter)window_get_opacity, (setter)window_set_opacity,
10781052
DOC_WINDOW_OPACITY, NULL},
1079-
{"display_index", (getter)window_get_display_index, NULL,
1080-
DOC_WINDOW_DISPLAYINDEX, NULL},
10811053
{"id", (getter)window_get_window_id, NULL, DOC_WINDOW_ID, NULL},
10821054
{NULL, 0, NULL, NULL, NULL} /* Sentinel */
10831055
};

0 commit comments

Comments
 (0)