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

Emit love.visible(true) on SDL_WINDOWEVENT_EXPOSED #2003

Closed
wants to merge 1 commit into from

Conversation

doesntgolf
Copy link

@doesntgolf doesntgolf commented Jan 9, 2024

I'm using the i3 window manager, and SDL is firing the SDL_WINDOWEVENT_EXPOSED when I switch from one workspace to the workspace Love is on. The SDL wiki says SDL_WINDOWEVENT_EXPOSED means the "window has been exposed and should be redrawn". I figured this fits in well enough to love.visible rather than needing its own callback.

@slime73
Copy link
Member

slime73 commented Jan 9, 2024

exposed has a slightly different meaning than becoming visible - it basically means something has happened to make the contents of the window no longer valid (for example the window manager decided to trash the backbuffer's data for whatever reason).

So I'd rather not send a visible event when it happens because the SDL event isn't saying the window transitioned from non-visible to visible.

@slime73
Copy link
Member

slime73 commented Jan 9, 2024

SDL3 introduces a new occluded event which says when the window exists but is no longer showing up - for example it's covered by other opaque windows or it's in a different virtual workspace from the user's active one. So it's kind of the other half of the goals of this change.

I think I'd rather wait for SDL3 to stabilize and love to switch to it before introducing something like this.

@doesntgolf
Copy link
Author

Sounds good, that makes sense. Thanks for the quick response!

@doesntgolf doesntgolf closed this Jan 9, 2024
@slime73
Copy link
Member

slime73 commented Jan 9, 2024

If you want to open a new issue in the issue tracker that might be handy, so we don't forget about the feature (and the reasons for wanting it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants