Skip to content

Fix SwitchBoard control not registering left side mouse clicks when shown on secondary left side monitors.#9854

Open
mpaperno wants to merge 1 commit intobambulab:masterfrom
mpaperno:mp/fix_switchboard_mm
Open

Fix SwitchBoard control not registering left side mouse clicks when shown on secondary left side monitors.#9854
mpaperno wants to merge 1 commit intobambulab:masterfrom
mpaperno:mp/fix_switchboard_mm

Conversation

@mpaperno
Copy link

Issue:
When a SwitchBoard control was shown on a secondary monitor, to the left of the primary, the control would never register a click on the left half. Therefore it was not possible to select the left option/toggle in several places, for example to switch back from "Hotends" view to "Filaments" in the device status panel.

Cause:
This was due to ClientToScreen(wxMouseEvent::GetPosition()) returning negative X values on screens arranged to the left of primary, which is how screen coordinates are typically reported.

Fix:
It is not necessary to do any coordinate mapping at all in this case because the mouse click's wxMouseEvent.GetPosition() is already in local widget coordinates (0,0 is always widget top left). So it is enough to simply check where the click X was in relation to half the control's current width.

UI Elements Affected (indirectly):

  • "Left/Right" Extruder switch in StatusPanel
  • "Filament/Hotends" switch in StatusPanel
  • "Open Door Detection" options in PrintOptionsDialog and SafetyOptionsDialog
  • "Purify Air at Print End" toggle option in PrintOptionsDialog
  • "Left/Right" selector in AmsReplaceMaterialDialog ("Auto Refill")

Thanks for your consideration,
-Max

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.

1 participant