Skip to content

[rcore][GLFW] Update window position in WindowMaximizeCallback()#5932

Open
rossberg wants to merge 1 commit into
raysan5:masterfrom
rossberg:fix.5931.maximize
Open

[rcore][GLFW] Update window position in WindowMaximizeCallback()#5932
rossberg wants to merge 1 commit into
raysan5:masterfrom
rossberg:fix.5931.maximize

Conversation

@rossberg

Copy link
Copy Markdown
Contributor

Update window position in WindowMaximizeCallback, since maximization does not appear to trigger WindowPosCallback on some platforms, such as MacOS.

Fixes #5931.

Update window position in MaximizeCallback, since maximization does not appear to invoke PosCallback (at least on MacOS).
@raysan5

raysan5 commented Jun 22, 2026

Copy link
Copy Markdown
Owner

@rossberg what about other platforms? this change can break other platforms

@rossberg

rossberg commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

@raysan5, how can it break anything? I assume that the intended invariant of CORE.Window.position is that it is always in sync with the actual window position. So in the worst case, it's a redundant call on platforms where Maximize already triggers the Pos callback (such as Win32).

(The minor cost of that redundancy seems fine, given that maximising/restoring a window is highly infrequent, and slow anyway.)

@raysan5

raysan5 commented Jun 22, 2026

Copy link
Copy Markdown
Owner

@rossberg did you test it in other platforms? I've been in this situation too many times...

@rossberg

Copy link
Copy Markdown
Contributor Author

It seems to work on MacOS and Windows. I can't test other platforms, unfortunately.

@raysan5 raysan5 added the enhancement This is an improvement of some feature label Jun 24, 2026
@raysan5 raysan5 changed the title [rcore][GLFW] Update window position in WindowMaximizeCallback [rcore][GLFW] Update window position in WindowMaximizeCallback() Jun 24, 2026
@raysan5

raysan5 commented Jun 24, 2026

Copy link
Copy Markdown
Owner

@rossberg I will test it on Windows, Linux, macOS as soon as possible (it could be several months)

@rossberg

Copy link
Copy Markdown
Contributor Author

Thanks. The other possible fix for #5931 (GetWindowPosition being broken right now) would be to revert 890ca8d.

@tjammer

tjammer commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

I can confirm that it works on linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This is an improvement of some feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[rcore] GetWindowPosition() incorrect after MaximizeWindow()

3 participants