Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defined WINDOWEVENT_MINIMIZED (so you don't have to check for '7') #2090

Merged
merged 1 commit into from Sep 13, 2020

Conversation

MyreMylar
Copy link
Contributor

closes #1749 by finishing off the last remaining bit of work there resulting from unit testing display.iconify().

Previously you had to check for the number '7' to conclusively identify the event generated when a window was iconified in pygame 2/SDL 2. Now it has its correct SDL 2 name.

@MightyJosip
Copy link
Contributor

Looks like we need to increase delta once again:

======================================================================
FAIL: test_delay (pygame.tests.time_test.TimeModuleTest)
Tests time.delay() function.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python38\lib\site-packages\pygame\tests\time_test.py", line 214, in test_delay
    self._wait_delay_check(pygame.time.delay, millis, iterations, delta)
  File "C:\Python38\lib\site-packages\pygame\tests\time_test.py", line 309, in _wait_delay_check
    self.assertAlmostEqual(wait_time, millis, delta=delta)
AssertionError: 111 != 50 within 50 delta (61 difference)
----------------------------------------------------------------------

Copy link
Member

@illume illume left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -472,7 +472,10 @@ required).
True if successful.

When the display is iconified ``pygame.display.get_active()`` will return
False. The event queue should receive a ``ACTIVEEVENT`` event when the
False. When using SDL 1 (usually in pygame versions less than 2.0.0) the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this backwards compatibility should be captured in an issue?

I think it's easier for users to read the wording pygame 2, rather than SDL1 or SDL2. Since understanding SDL versions is maybe above the heads of most people.

@illume illume merged commit 866d352 into master Sep 13, 2020
@illume illume deleted the window-event-minimised branch September 13, 2020 08:24
@illume illume added event pygame.event display pygame.display labels Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display pygame.display event pygame.event
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add unit test: display.iconify()
3 participants