Skip to content

fix: touch scaling bug and initialize display variables as 0#4758

Merged
ReenigneArcher merged 1 commit intomasterfrom
fix/double-offset
Apr 22, 2026
Merged

fix: touch scaling bug and initialize display variables as 0#4758
ReenigneArcher merged 1 commit intomasterfrom
fix/double-offset

Conversation

@ReenigneArcher
Copy link
Copy Markdown
Member

@ReenigneArcher ReenigneArcher commented Feb 22, 2026

Description

Initialize additional display_t members (env_width/env_height/env_logical_width/env_logical_height/width/height/logical_width/logical_height) in the constructor to ensure consistent defaults. Fix touch input scaling on Windows by removing a redundant addition of display offsets (preventing double-offsetting for multi-monitor setups) and adding a clarifying comment. Tighten the video coordinate check to use explicit >0 comparisons for logical/env sizes before computing scaling factors.

TODO:

  • Test to ensure no regressions on different platforms
    • Windows
    • Linux
    • macOS

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 22, 2026

Bundle Report

Bundle size has no change ✅

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 22, 2026

Codecov Report

❌ Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.19%. Comparing base (f4ebfbb) to head (a80eae3).
⚠️ Report is 3 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/windows/input.cpp 0.00% 2 Missing ⚠️
src/video.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4758      +/-   ##
==========================================
+ Coverage   18.17%   18.19%   +0.01%     
==========================================
  Files         109      109              
  Lines       23545    23552       +7     
  Branches    10391    10391              
==========================================
+ Hits         4280     4285       +5     
+ Misses      16010    14959    -1051     
- Partials     3255     4308    +1053     
Flag Coverage Δ
Archlinux 11.55% <50.00%> (-0.02%) ⬇️
FreeBSD-14.3-aarch64 ?
FreeBSD-14.3-amd64 13.78% <91.66%> (+0.04%) ⬆️
Homebrew-ubuntu-22.04 13.92% <50.00%> (-0.02%) ⬇️
Linux-AppImage 12.50% <50.00%> (-0.02%) ⬇️
Windows-AMD64 14.87% <25.00%> (-0.02%) ⬇️
Windows-ARM64 13.24% <78.57%> (+0.04%) ⬆️
macOS-arm64 19.07% <91.66%> (+0.05%) ⬆️
macOS-x86_64 18.41% <91.66%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/platform/common.h 37.16% <100.00%> (+4.14%) ⬆️
src/video.cpp 32.37% <0.00%> (-0.12%) ⬇️
src/platform/windows/input.cpp 0.58% <0.00%> (ø)

... and 35 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f4ebfbb...a80eae3. Read the comment docs.

@ReenigneArcher ReenigneArcher force-pushed the fix/double-offset branch 4 times, most recently from 619caf9 to 80a272c Compare February 28, 2026 02:30
@sonarqubecloud
Copy link
Copy Markdown

Initialize additional display_t members (env_width/env_height/env_logical_width/env_logical_height/width/height/logical_width/logical_height) in the constructor to ensure consistent defaults. Fix touch input scaling on Windows by removing a redundant addition of display offsets (preventing double-offsetting for multi-monitor setups) and adding a clarifying comment. Tighten the video coordinate check to use explicit >0 comparisons for logical/env sizes before computing scaling factors.

Co-Authored-By: Chase Payne <27069224+nonary@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@Kishi85
Copy link
Copy Markdown
Contributor

Kishi85 commented Apr 22, 2026

Tested this on Linux:

@ReenigneArcher ReenigneArcher marked this pull request as ready for review April 22, 2026 18:40
@ReenigneArcher
Copy link
Copy Markdown
Member Author

Thank you @Kishi85

@ReenigneArcher ReenigneArcher merged commit 293c1ed into master Apr 22, 2026
73 checks passed
@ReenigneArcher ReenigneArcher deleted the fix/double-offset branch April 22, 2026 18:41
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.

mouse movement issue with 2 monitors Uninitialized display_t members cause garbage touch/absolute input on Windows

2 participants