Skip to content

Fix: restore original PlotControl after closing new window#4529

Merged
swharden merged 2 commits intoScottPlot:mainfrom
david3951445:main
Nov 19, 2024
Merged

Fix: restore original PlotControl after closing new window#4529
swharden merged 2 commits intoScottPlot:mainfrom
david3951445:main

Conversation

@david3951445
Copy link
Copy Markdown
Contributor

This PR addresses an issue in ScottPlot 5 related to the "Open in New Window" functionality in both WinForms and WPF.

  • Issue:
    • In WPF, after closing the new window, the ContextMenu on the original window would no longer appear.
    • In WinForms, the ContextMenu was shown at the wrong position because it was being displayed on the new PlotControl instead of the original one.
  • Cause: The issue occurred because, during the process of moving the Plot content to the new window, the original window’s PlotControl was overwritten but not properly restored when the new window was closed.
  • Solution: After the new window is closed, the PlotControl on the original window is properly restored, ensuring the ContextMenu behaves as expected.

@swharden
Copy link
Copy Markdown
Member

Thanks @david3951445, this looks great! I'm happy to see this bug fixed in the next release 🚀

@swharden swharden enabled auto-merge (squash) November 19, 2024 13:39
@swharden swharden merged commit 13c05e8 into ScottPlot:main Nov 19, 2024
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.

2 participants