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

Keep all window events in SDL2 #1897

Merged
merged 1 commit into from Jun 9, 2020

Conversation

robertpfeiffer
Copy link
Contributor

generate additional compatibility events instead of mangling.
This should help with #1720 on Linux, make pygame's usage of the SDL2 API "more correct", more future-proof, and make behaviour more consistent across platforms.

Especially when minimising and maximising, additional videoexpose events are generated, which are needed for SCALED to work correctly.

@xandark, does this work for you?

@illume
Copy link
Member

illume commented Jun 2, 2020

To reproduce:

  • linux (X11 or wayland?), pygame with SDL2
  • python3 -m pygame.examples.aliens
  • bring another window in front (quick before aliens get you)
  • see garbage in aliens window

#1720 (comment)

@xandark
Copy link

xandark commented Jun 2, 2020

@robertpfeiffer looking at your description, that sounds good to me

@illume sorry, forgot to say it was X11 that I reported the original issue upon, but yes, those steps to reproduce are correct

@MyreMylar
Copy link
Contributor

MyreMylar commented Jun 3, 2020

@robertpfeiffer looking at your description, that sounds good to me

I think robert was hoping you would be able to test his fix to see if it worked. To do this you would need to download the zip of his branch from here:

https://github.com/robertpfeiffer/pygame/tree/keep-window-expose-events

unzip it and name the directory pygame, and then build and install it by navigating to the directory of the unzipped zip running something like:

python -m buildconfig -sdl2
python setup.py build
python -m pip install . -U

Unless you already did that and I misunderstood? You might need some sudos in there.

@xandark
Copy link

xandark commented Jun 4, 2020

@MyreMylar ah, thank you, I didn't know the protocol, I'll follow your instructions tomorrow

@illume
Copy link
Member

illume commented Jun 4, 2020

There's a way to install via a commit:

python -m pip install git+git://github.com/robertpfeiffer/pygame.git@3a3c8a8b1399890e429730f5040d3755ecc31cde --user

Or install via a branch:

python -m pip install https://github.com/robertpfeiffer/pygame/archive/keep-window-expose-events.zip --user

@illume illume added the needs-testing This issue requires testing on one or more platforms label Jun 4, 2020
@xandark
Copy link

xandark commented Jun 7, 2020

Okay, I managed to build the special dev11 branch via the python -m pip install https://github.com/robertpfeiffer/pygame/archive/keep-window-expose-events.zip --user command, thank you, that worked great for me.

But the issue remains when testing on X11; it didn't fix it. In other words, bringing another window in front of the Aliens example and then bringing Aliens to the front again does not cause Aliens' window to repaint.

@MyreMylar MyreMylar removed the needs-testing This issue requires testing on one or more platforms label Jun 8, 2020
@MyreMylar
Copy link
Contributor

This seems more correct to me, even if it doesn't resolve the multi-monitor mac issue so I'm going to approve it on general principles.

@illume
Copy link
Member

illume commented Jun 8, 2020

even if it doesn't resolve the multi-monitor mac issue so I'm going to approve it on general principles.

Was this tested by someone as well? I saw xandark above tested on X11.

@MyreMylar
Copy link
Contributor

even if it doesn't resolve the multi-monitor mac issue so I'm going to approve it on general principles.

Was this tested by someone as well? I saw xandark above tested on X11.

Nope, I'm just getting my bugs confused because Xandark posted about the issue in that issue thread here:
#1720

Sadly, I have only one monitor and 0 macs so I can neither confirm or deny that this PR does anything for them.

@robertpfeiffer
Copy link
Contributor Author

I think @xandark might be having a different problem altogether - neither this one, nor #1720 on mac. As long as pygame.examples.setmodescale works on KDE neon (with the white circle moving), we can merge this. It works on Linux on my machines.

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.

👍

@illume illume changed the title keep all window events Keep all window events in SDL2 Jun 9, 2020
@illume illume added the event pygame.event label Jun 9, 2020
@illume illume merged commit 3725ea8 into pygame:master Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event pygame.event
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants