8
8
from pygame import display
9
9
from pygame .tests .test_utils import question
10
10
11
+ pygame .display .init ()
12
+ is_wayland = pygame .display .get_driver () == "wayland"
13
+ pygame .display .quit ()
14
+
11
15
12
16
class DisplayModuleTest (unittest .TestCase ):
13
17
default_caption = "pygame window"
@@ -71,6 +75,7 @@ def test_get_active(self):
71
75
os .environ .get ("SDL_VIDEODRIVER" ) == pygame .NULL_VIDEODRIVER ,
72
76
"requires the SDL_VIDEODRIVER to be a non-null value" ,
73
77
)
78
+ @unittest .skipIf (is_wayland , "broken on wayland" )
74
79
def test_get_active_iconify (self ):
75
80
"""Test the get_active function after an iconify"""
76
81
@@ -411,6 +416,7 @@ def test_gl_set_attribute(self):
411
416
os .environ .get ("SDL_VIDEODRIVER" ) in [pygame .NULL_VIDEODRIVER , "android" ],
412
417
"iconify is only supported on some video drivers/platforms" ,
413
418
)
419
+ @unittest .skipIf (is_wayland , "broken on wayland" )
414
420
def test_iconify (self ):
415
421
pygame .display .set_mode ((640 , 480 ))
416
422
@@ -519,6 +525,7 @@ def test_quit__multiple(self):
519
525
pygame .version .SDL >= (2 , 32 , 50 ),
520
526
"set_gamma is removed in SDL3, does not work in sdl2-compat either" ,
521
527
)
528
+ @unittest .skipIf (is_wayland , "not supported on wayland" )
522
529
def test_set_gamma (self ):
523
530
pygame .display .set_mode ((1 , 1 ))
524
531
@@ -537,6 +544,7 @@ def test_set_gamma(self):
537
544
pygame .version .SDL >= (2 , 32 , 50 ),
538
545
"set_gamma is removed in SDL3, does not work in sdl2-compat either" ,
539
546
)
547
+ @unittest .skipIf (is_wayland , "not supported on wayland" )
540
548
def test_set_gamma__tuple (self ):
541
549
pygame .display .set_mode ((1 , 1 ))
542
550
@@ -690,6 +698,7 @@ def test_toggle_fullscreen(self):
690
698
(test_surf .get_width (), test_surf .get_height ()), width_height
691
699
)
692
700
701
+ @unittest .skipIf (is_wayland , "not supported on wayland" )
693
702
def test_get_set_window_position (self ):
694
703
pygame .display .set_mode ((500 , 500 ))
695
704
pygame .display .set_window_position ((420 , 360 ))
0 commit comments