88from pygame import display
99from pygame .tests .test_utils import question
1010
11+ pygame .display .init ()
12+ is_wayland = pygame .display .get_driver () == "wayland"
13+ pygame .display .quit ()
14+
1115
1216class DisplayModuleTest (unittest .TestCase ):
1317 default_caption = "pygame window"
@@ -71,6 +75,7 @@ def test_get_active(self):
7175 os .environ .get ("SDL_VIDEODRIVER" ) == pygame .NULL_VIDEODRIVER ,
7276 "requires the SDL_VIDEODRIVER to be a non-null value" ,
7377 )
78+ @unittest .skipIf (is_wayland , "broken on wayland" )
7479 def test_get_active_iconify (self ):
7580 """Test the get_active function after an iconify"""
7681
@@ -411,6 +416,7 @@ def test_gl_set_attribute(self):
411416 os .environ .get ("SDL_VIDEODRIVER" ) in [pygame .NULL_VIDEODRIVER , "android" ],
412417 "iconify is only supported on some video drivers/platforms" ,
413418 )
419+ @unittest .skipIf (is_wayland , "broken on wayland" )
414420 def test_iconify (self ):
415421 pygame .display .set_mode ((640 , 480 ))
416422
@@ -519,6 +525,7 @@ def test_quit__multiple(self):
519525 pygame .version .SDL >= (2 , 32 , 50 ),
520526 "set_gamma is removed in SDL3, does not work in sdl2-compat either" ,
521527 )
528+ @unittest .skipIf (is_wayland , "not supported on wayland" )
522529 def test_set_gamma (self ):
523530 pygame .display .set_mode ((1 , 1 ))
524531
@@ -537,6 +544,7 @@ def test_set_gamma(self):
537544 pygame .version .SDL >= (2 , 32 , 50 ),
538545 "set_gamma is removed in SDL3, does not work in sdl2-compat either" ,
539546 )
547+ @unittest .skipIf (is_wayland , "not supported on wayland" )
540548 def test_set_gamma__tuple (self ):
541549 pygame .display .set_mode ((1 , 1 ))
542550
@@ -690,6 +698,7 @@ def test_toggle_fullscreen(self):
690698 (test_surf .get_width (), test_surf .get_height ()), width_height
691699 )
692700
701+ @unittest .skipIf (is_wayland , "not supported on wayland" )
693702 def test_get_set_window_position (self ):
694703 pygame .display .set_mode ((500 , 500 ))
695704 pygame .display .set_window_position ((420 , 360 ))
0 commit comments