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

perf: ignore WM_SHOWWINDOW hide event #4198

Merged
merged 3 commits into from
Dec 3, 2022

Conversation

kornes
Copy link
Contributor

@kornes kornes commented Nov 28, 2022

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

handleSHOWWINDOW is triggered by Windows for show and hide events; currently every tooltip (emotes, badges, links preview, split header) will run this function on mouse enter and leave.
Content of the function only cares about show event, so this PR introduce changes to minimze wasted cpu use:

  • early exit when msg->wParam is false, meaning it was sent for hide event
  • move calcButtonsSizes() (3 control buttons in custom frame title) to shown_ block, so its called only once at first show event (resizing/scale change is covered elesewhere)
  • early exit calcButtonsSizes() when window has no such buttons (frameless_)
  • fix one call to calcButtonsSizes() outside of windows ifdef

tested:

  • all mentioned tooltips show correctly
  • calcButtonSizes works, resizing is not affected

suggest no changelog

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2022

clang-tidy review says "All clean, LGTM! 👍"

@pajlada pajlada merged commit edd4789 into Chatterino:master Dec 3, 2022
@kornes kornes deleted the ref_basewindow-show-event branch December 3, 2022 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants