@@ -779,6 +779,13 @@ window_get_opengl(pgWindowObject *self, void *v)
779779 return PyBool_FromLong (hasGL );
780780}
781781
782+ static PyObject *
783+ window_get_utility (pgWindowObject * self , void * v )
784+ {
785+ return PyBool_FromLong (SDL_GetWindowFlags (self -> _win ) &
786+ SDL_WINDOW_UTILITY );
787+ }
788+
782789static void
783790window_dealloc (pgWindowObject * self , PyObject * _null )
784791{
@@ -944,6 +951,14 @@ window_init(pgWindowObject *self, PyObject *args, PyObject *kwargs)
944951 if (_value_bool )
945952 flags |= SDL_WINDOW_VULKAN ;
946953 }
954+ else if (!strcmp (_key_str , "utility" )) {
955+ if (_value_bool ) {
956+ flags |= SDL_WINDOW_UTILITY ;
957+ #if !SDL_VERSION_ATLEAST (3 , 0 , 0 )
958+ flags |= SDL_WINDOW_SKIP_TASKBAR ;
959+ #endif
960+ }
961+ }
947962 else {
948963 PyErr_Format (PyExc_TypeError ,
949964 "__init__ got an unexpected flag \'%s\'" ,
@@ -1195,6 +1210,7 @@ static PyGetSetDef _window_getset[] = {
11951210 DOC_WINDOW_OPACITY , NULL },
11961211 {"id" , (getter )window_get_window_id , NULL , DOC_WINDOW_ID , NULL },
11971212 {"opengl" , (getter )window_get_opengl , NULL , DOC_WINDOW_OPENGL , NULL },
1213+ {"utility" , (getter )window_get_utility , NULL , DOC_WINDOW_UTILITY , NULL },
11981214 {NULL , 0 , NULL , NULL , NULL } /* Sentinel */
11991215};
12001216
0 commit comments