Fix invisible mouse cursor in QRhi panes on Windows (#1096)#1103
Conversation
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>
1c36044 to
23de1eb
Compare
There was a problem hiding this comment.
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 ofinitialize()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.
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>
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:
QRhiWidgetcreates its native HWND lazily on the firstinitialize()call. ThesetCursor(Qt::CrossCursor)call inSpectrumWidget's constructor runs before that HWND exists, so the HWND is registered withhCursor = NULL. When the mouse enters the surface, Windows callsSetCursor(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 itsQRhiWidgetchild.Fix:
SpectrumWidget::initialize(): re-applysetCursor(cursor())at the end, after the native HWND existsPanadapterAppletconstructor: givem_cwPanelan explicitQt::ArrowCursorso it does not inherit the invisible cursor from its native-window parentTest plan
🤖 Generated with Claude Code