Skip to content

Fix invisible mouse cursor in QRhi panes on Windows (#1096)#1103

Merged
ten9876 merged 1 commit into
aethersdr:mainfrom
AetherClaude:aetherclaude/issue-1096
Apr 10, 2026
Merged

Fix invisible mouse cursor in QRhi panes on Windows (#1096)#1103
ten9876 merged 1 commit into
aethersdr:mainfrom
AetherClaude:aetherclaude/issue-1096

Conversation

@aethersdr-agent

Copy link
Copy Markdown
Contributor

Fixes #1096

Summary

The mouse cursor disappears when hovering over the panadapter, waterfall, and CW decoder panes on Windows 11. These are the three QRhiWidget-rendered panes; all standard Qt widget panes are unaffected.

Root cause: QRhiWidget creates its native HWND lazily on the first initialize() call. The setCursor(Qt::CrossCursor) call in SpectrumWidget's constructor runs before that HWND exists, so the HWND is registered with hCursor = NULL. When the mouse enters the surface, Windows calls SetCursor(NULL), making the cursor invisible. The CW panel inherits the same invisible cursor because its parent (PanadapterApplet) was promoted to a native window due to its QRhiWidget child.

Fix:

  • SpectrumWidget::initialize(): re-apply setCursor(cursor()) at the end, after the native HWND exists
  • PanadapterApplet constructor: give m_cwPanel an explicit Qt::ArrowCursor so it does not inherit the invisible cursor from its native-window parent

Test plan

  • Launch AetherSDR on Windows 11 and connect to a radio
  • Move the cursor into the panadapter pane — cursor should remain visible
  • Move the cursor into the waterfall pane — cursor should remain visible
  • Enable CW mode and move cursor into the CW decoder panel — cursor should remain visible
  • Verify cursor shape changes (cross, resize, hand) still work correctly within the spectrum widget
  • Verify no regression on macOS and Linux

🤖 Generated with Claude Code

Re-apply cursor in SpectrumWidget::initialize() after the native HWND
is created by QRhiWidget (setCursor in the constructor runs too early on
Windows, leaving the HWND with hCursor=NULL). Also give m_cwPanel an
explicit ArrowCursor so it does not inherit the invisible cursor from its
native-window parent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aethersdr-agent aethersdr-agent Bot force-pushed the aetherclaude/issue-1096 branch from 1c36044 to 23de1eb Compare April 10, 2026 00:20

@aethersdr-agent aethersdr-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix — the cursor logic itself is correct and well-explained.

Two things to flag:

1. Out-of-scope changes (significant)

The diff includes substantial additions to renderGpuFrame() and paintEvent() in SpectrumWidget.cpp that add a propagation-forecast overlay (K-index / SFI). These have nothing to do with the cursor bug. They reference m_propForecastVisible, m_propKIndex, and m_propSfi — member variables not introduced in this PR. This should be a separate PR with its own issue, description, and test plan. Please split this out before merging.

2. Label order inconsistency between rendering paths

In renderGpuFrame() the composite label is built left-to-right as prop → WNB → RF gain, then drawn right-aligned as a single string. In paintEvent() the individual segments are laid out right-to-left as RF gain → WNB → prop. The two paths produce opposite left-right orderings, so the overlay looks different depending on whether the GPU or CPU paint path is active.


The cursor fix itself (in scope):

  • setCursor(cursor()) at the end of initialize() is the right approach — idempotent and correctly deferred until the HWND exists.
  • m_cwPanel->setCursor(Qt::ArrowCursor) for the CW panel is appropriate given the native-window parent inheritance issue.

Please split out the prop-forecast rendering and fix the ordering inconsistency, then this will be good to go.

@ten9876 ten9876 merged commit b2ed3f0 into aethersdr:main Apr 10, 2026
5 checks passed
aethersdr-agent Bot added a commit that referenced this pull request Apr 10, 2026
Re-apply cursor in SpectrumWidget::initialize() after the native HWND
is created by QRhiWidget (setCursor in the constructor runs too early on
Windows, leaving the HWND with hCursor=NULL). Also give m_cwPanel an
explicit ArrowCursor so it does not inherit the invisible cursor from its
native-window parent.

Co-authored-by: aethersdr-agent[bot] <273844287+aethersdr-agent[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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 cursor disappears when hovering over panadapter, waterfall, and CW decoder panes (Windows 11)

1 participant