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

Reimplement Windows Message Pump #39

Closed
marti4d opened this issue Sep 20, 2017 · 2 comments
Closed

Reimplement Windows Message Pump #39

marti4d opened this issue Sep 20, 2017 · 2 comments
Assignees
Labels

Comments

@marti4d
Copy link

marti4d commented Sep 20, 2017

Currently, Anvil's main loop uses the Windows command GetMessage() to dispatch messages to the window procedure, and intercepts the WM_PAINT message to draw.

This is not the intended use of WM_PAINT, which is meant to be used for the Windows GDI with the ValidateRect() and InvalidateRect() calls to update the client's area back when Windows was still using a stacking window manager.

The only reason this works properly right now is because Anvil does not properly handle the WM_PAINT call, which forces Windows to send it to the app window over-and-over again in hopes that the app will eventually paint its window properly.

Anvil's loop should likely switch to a message pump that looks kind-of like this (Except I would put the check for WM_QUIT in the while(PeekMessage(...)) loop)

And WM_PAINT should probably just be ignored and passed off to the default window procedure (which will just validate the entire client area, stopping future WM_PAINT messages)

@DominikWitczakAMD
Copy link
Contributor

Thanks for spotting this. I will be modifying related logic in the coming weeks, so this issue should hopefully be addressed fairly quickly (though changes they will make it to the public repo this week are very scarce).

@DominikWitczakAMD
Copy link
Contributor

Actually, this one proved to be trivial to fix :-) Addressed internally already, so the patch will be included in the coming update.

DominikWitczakAMD added a commit that referenced this issue Oct 4, 2017
Bug-fixes and improvements; Addresses #36, #37, #39, #40, partially #…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants