Skip to content

Investigate need for 'widget selection correction' preference (confusing, platform-dependent) #2558

Description

@dcwhite

Summary

Renderer settings has a "Viewer widget selection correction" checkbox (label: "Viewer widget selection correction--enable if widgets don't respond to shift-click actions") that is confusing to users and appears to be platform-dependent in whether it's needed. We should figure out why it exists, when it's actually required, and whether it can be automated or removed instead of exposed as a user-facing toggle.

Where it lives

  • Preference definition: Core/Application/Preferences/Preferences.h:89 / Core/Application/Preferences/Preferences.cc:54 (widgetSelectionCorrection, defaults to false)
  • UI checkbox: Interface/Application/Preferences.ui:415-419, wired up in Interface/Application/PreferencesWindow.cc / .h
  • Persisted setting: Interface/Application/Settings.cc:304-306
  • Actual effect: Interface/Modules/Render/ES/SRInterface.cc:558 — passed into the widget-selection shader as a uniform literally named "hack":
    applyUniform(entityID, SpireSubPass::Uniform("hack", Preferences::Instance().widgetSelectionCorrection));
    In the vertex shader (same file, ~line 523) it conditionally rewrites gl_Position:
    if(hack) gl_Position.xy = ((gl_Position.xy/gl_Position.w) * vec2(0.5) - vec2(0.5)) * gl_Position.w;

Why this is confusing

  • The setting's own label admits it's a workaround ("enable if widgets don't respond to shift-click actions") rather than describing what it does.
  • The underlying shader uniform is literally named hack, suggesting it was a stopgap fix rather than a real solution.
  • Users have no way to know in advance whether they need it — it depends on OS/GPU/driver combination, not anything visible in the UI.
  • Defaulting to false means affected users hit broken widget picking with no indication that this checkbox is the fix.

Tasks

  • Find/reconstruct the history of why this was added (git blame / PR history on SRInterface.cc around this uniform)
  • Determine which platforms/GPUs/drivers actually need hack = true for correct widget picking
  • Understand the actual coordinate transform bug this is compensating for (looks related to projection normalization for selection picking) and whether it can be fixed properly instead of toggled
  • If a real fix isn't feasible short-term, consider auto-detecting the condition instead of requiring a manual, unexplained user toggle
  • Rename/document the shader uniform and preference regardless of outcome (hack is not an acceptable long-term name)

Metadata

Metadata

Assignees

Type

Fields

No fields configured for Bug.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions