Skip to content

fix: missing initializers and incorrect default for native_pen_touch - #5693

Merged
ReenigneArcher merged 1 commit into
LizardByte:masterfrom
cgutman:missing_member_init
Sep 12, 2026
Merged

fix: missing initializers and incorrect default for native_pen_touch#5693
ReenigneArcher merged 1 commit into
LizardByte:masterfrom
cgutman:missing_member_init

Conversation

@cgutman

@cgutman cgutman commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Description

We keep forgetting to update config_t when we add new config options, which causes bugs like #5520. Fix this and all other missing initializers and enable -Wmissing-field-initializers to stop these issues from getting introduced again in the future.

The only behavior change in this PR is adding key_rightalt_to_key_win which fixes #5520. All others are either default initialized already or values that are never read.

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

See our AI usage policy.

  • 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

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

ReenigneArcher
ReenigneArcher previously approved these changes Sep 11, 2026
@ReenigneArcher

Copy link
Copy Markdown
Member

Awesome, thanks for this!

Looks like it might be different for clang? https://github.com/LizardByte/Sunshine/actions/runs/34655808950/job/103447879614?pr=5693#step:11:4294

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 29.12621% with 73 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.66%. Comparing base (0f7dcf3) to head (003cc0a).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/linux/vulkan_encode.cpp 0.00% 34 Missing ⚠️
src/platform/linux/portalgrab.cpp 8.33% 11 Missing ⚠️
src/platform/linux/graphics.cpp 0.00% 8 Missing ⚠️
src/input.cpp 14.28% 6 Missing ⚠️
src/platform/linux/kmsgrab.cpp 0.00% 6 Missing ⚠️
src/platform/linux/cuda.cpp 0.00% 3 Missing ⚠️
src/platform/linux/vaapi.cpp 0.00% 3 Missing ⚠️
src/video.cpp 92.59% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5693      +/-   ##
==========================================
+ Coverage   37.53%   37.66%   +0.12%     
==========================================
  Files         102      104       +2     
  Lines       25478    26094     +616     
  Branches    11294    11559     +265     
==========================================
+ Hits         9562     9827     +265     
- Misses      14953    14990      +37     
- Partials      963     1277     +314     
Flag Coverage Δ
Alpine-aarch64 22.57% <9.52%> (-0.01%) ⬇️
Alpine-x86_64 22.69% <9.52%> (-0.01%) ⬇️
Archlinux 21.27% <8.06%> (-0.01%) ⬇️
FreeBSD-amd64 23.47% <23.80%> (+<0.01%) ⬆️
Homebrew-macos-15 37.27% <42.85%> (-0.02%) ⬇️
Homebrew-macos-26 37.58% <42.85%> (-0.01%) ⬇️
Homebrew-ubuntu-24.04 24.57% <10.60%> (-0.01%) ⬇️
Linux-AppImage-aarch64 25.85% <10.60%> (-0.01%) ⬇️
Linux-AppImage-x86_64 26.06% <10.60%> (-0.01%) ⬇️
Windows-AMD64 30.42% <85.71%> (+0.02%) ⬆️
Windows-ARM64 25.46% <85.71%> (?)
macOS-arm64 30.81% <60.00%> (-0.02%) ⬇️
macOS-x86_64 31.43% <60.00%> (-0.02%) ⬇️

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

Files with missing lines Coverage Δ
src/config.cpp 60.95% <100.00%> (-0.27%) ⬇️
src/platform/common.h 61.19% <ø> (+0.29%) ⬆️
src/platform/linux/wayland.cpp 7.22% <ø> (ø)
src/platform/windows/display_base.cpp 36.80% <100.00%> (+1.04%) ⬆️
src/platform/windows/display_vram.cpp 10.23% <100.00%> (+1.56%) ⬆️
src/video.cpp 54.62% <92.59%> (-0.76%) ⬇️
src/platform/linux/cuda.cpp 1.70% <0.00%> (ø)
src/platform/linux/vaapi.cpp 2.58% <0.00%> (ø)
src/input.cpp 47.86% <14.28%> (-0.17%) ⬇️
src/platform/linux/kmsgrab.cpp 3.73% <0.00%> (ø)
... and 3 more

... and 50 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

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

@cgutman

cgutman commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

It looks like GCC doesn't have an equivalent of -Wno-missing-designated-field-initializers, so I just made the warning change for Clang 19+. Currently that means it's getting exercised on FreeBSD, Windows ARM64, and macOS 26.

Since the actual missing initializer bugs have been in shared code (config.cpp and video.cpp), this should still be enough to catch future issues.

@cgutman
cgutman force-pushed the missing_member_init branch from 79ddc5b to 38800a6 Compare September 12, 2026 05:49
@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown
Last Updated 2026-09-12 14:25:55 UTC
Source Run CI Run #5495
Commit 003cc0a4fc7dc8930eae8f24eb57fcba858b5dd8

Screenshot Comparison

PR #5693 screenshots vs screenshots baseline.

Matrix: AppImage-aarch64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: AppImage-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-AMD64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: Windows-ARM64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-arm64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

Matrix: macOS-x86_64

Image Baseline PR
sunshine_tray_initial.png
sunshine_tray_menu.png
sunshine_tray_pairing_request.png
sunshine_tray_paused.png
sunshine_tray_stopped.png
sunshine_tray_streaming.png
sunshine_tray_tooltip.png

@ReenigneArcher

Copy link
Copy Markdown
Member

Apparently if we use -Wall -Wextra -Wpedantic with -Werror it will include this automatically (in the supported compilers).

@cgutman
cgutman force-pushed the missing_member_init branch from 38800a6 to 003cc0a Compare September 12, 2026 13:27
@cgutman

cgutman commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

-Wextra and -Wpedantic includes a ton of other warnings that we probably don't want (or at least would need a ton more code changes to build cleanly).

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
5.6% Duplication on New Code (required ≤ 2%)
6 Duplicated Blocks on New Code (required ≤ 0)

See analysis details on SonarQube Cloud

@ReenigneArcher

Copy link
Copy Markdown
Member

-Wextra and -Wpedantic includes a ton of other warnings that we probably don't want (or at least would need a ton more code changes to build cleanly).

Okay, I can look into for the future. Don't want to derail this PR for sure.

@ReenigneArcher
ReenigneArcher merged commit fbf12d0 into LizardByte:master Sep 12, 2026
78 of 80 checks passed
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.

[Bug] Touch/pen input disabled when native_pen_touch omitted from config (v2026.808 regression)

2 participants