Skip to content

Client window size fix #276

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

UTengine
Copy link
Contributor

@UTengine UTengine commented Apr 24, 2025

AdjustWindowRect (and AdjustWindowRectEx) already include the necessary system metrics like borders, title bar height (SM_CYCAPTION), and so on based on the window style you pass in. So manually adding them is not needed. We create the rectangle specify the resolution from the .ini file then we ask AdjustWindowRect to essentially "simulate" the window frame size ahead of time, before actually creating the window — and that’s exactly the intended use case for AdjustWindowRect we then pass the same parameters to the CreateWindow function.
image

💔 Thank you!

🚨 Checklist for this Pull Request

  • Provide a link to the ticket your pull request addresses or resolves. If there isn't one, create it.
  • Ensure you are making a pull request against the canary branch (left side). Start your branch from our canary.
  • Verify that your commit messages follow our style guidelines: start with a capitalized verb and limit the title to 72 characters; the description can be longer.
  • Ensure your code additions pass linting checks (run the format.ps1 script) and avoid irrelevant diffs.
  • Ensure your pull request contains isolated changes. Ideally, create separate PRs for unrelated changes.

AdjustWindowRect (and AdjustWindowRectEx) already include the necessary system metrics like borders, title bar height (SM_CYCAPTION), and so on  based on the window style you pass in. So manually adding them is not needed.
We create the rectangle specify the resolution from the .ini file then we ask AdjustWindowRect to essentially "simulate" the window frame size ahead of time, before actually creating the window — and that’s exactly the intended use case for AdjustWindowRect we then pass the same parameters to the CreateWindow function.
@xGuTeK xGuTeK added the official_client_code_review Needs verification against the official client code using IDA/Ghidra label Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
official_client_code_review Needs verification against the official client code using IDA/Ghidra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants