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

SDL: Unbreak window state save & restore #1627

Merged
merged 3 commits into from
Jun 29, 2023

Conversation

NiLuJe
Copy link
Member

@NiLuJe NiLuJe commented Jun 27, 2023

Fix koreader/koreader#10502, regression since #1610

Well, only the size is a regression (plus, it was sortof an ffi/framebuffer API break, even if SDL is quirky in that fb.h / fb.w might not match fb.bb's dimensions because HiDPI shenanigans).

The position one is a bit of a mystery, we get an initial move event no matter what, for some reason, and without the explicit set, it's at the top left despite passing the right stuff to CreateWindow o_O.

Also dropped a duplicate openGameController call, as we handle it via an SDL_CONTROLLERDEVICEADDED event already.


This change is Reviewable

@Frenzie
Copy link
Member

Frenzie commented Jun 28, 2023

Also dropped a duplicate openGameController call, as we handle it via an SDL_CONTROLLERDEVICEADDED event already.

Are you sure? If my memory doesn't betray me (but it might, I wrote that like five years ago?) the event only occurs when you plug in a controller, while normally it's already plugged in.

@NiLuJe
Copy link
Member Author

NiLuJe commented Jun 28, 2023

Are you sure?

Works for me on Linux w/ a Sony DS4v2, FWIW.

@Frenzie
Copy link
Member

Frenzie commented Jun 28, 2023

Indeed, I can also confirm that it works on my Hori on SDL 2.26.5.

@Frenzie
Copy link
Member

Frenzie commented Jun 29, 2023

Did you want to rebase it into two commits or just squash the whole thing together?

@NiLuJe
Copy link
Member Author

NiLuJe commented Jun 29, 2023

Squash, definitely ;).

@Frenzie Frenzie merged commit e465170 into koreader:master Jun 29, 2023
2 checks passed
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.

Window size is lost upon upgrade from 2023.04; also not being saved on subsequent restarts of 2023.05
2 participants