Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use IPC message to focus on serial plotter window #1410

Merged
merged 1 commit into from
Sep 15, 2022
Merged

Conversation

AlbyIanna
Copy link
Contributor

Motivation

When serial plotter is already running, trying to open it again should bring the focus to the plotter window. Currently it's not working because running window.focus() raises the a cross-origin error:

Blocked a frame with origin "file://" from accessing a cross-origin frame

Change description

Let the renderer send an IPC message to the backend, which in turn would show the serial plotter window.

Other information

Fixes #1346

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@AlbyIanna AlbyIanna self-assigned this Sep 7, 2022
@AlbyIanna AlbyIanna added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Sep 7, 2022
@AlbyIanna AlbyIanna marked this pull request as draft September 7, 2022 10:42
@AlbyIanna AlbyIanna changed the title Use message to focus on serial plotter window Use IPC message to focus on serial plotter window Sep 7, 2022
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

I tested on Windows and Linux and it is working fine.

Thanks Alberto!

Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

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

Thank you!

@AlbyIanna AlbyIanna marked this pull request as ready for review September 15, 2022 07:37
@AlbyIanna AlbyIanna merged commit 4e590ab into main Sep 15, 2022
@AlbyIanna AlbyIanna deleted the fix-focus-plotter branch September 15, 2022 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bring existing Serial Plotter window to foreground when selected from IDE UI
3 participants