8000 feat: add force option to app.focus() by codebytere · Pull Request #22612 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: add force option to app.focus() #22612

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

Merged
merged 2 commits into from
Mar 11, 2020
Merged

feat: add force option to app.focus() #22612

merged 2 commits into from
Mar 11, 2020

Conversation

codebytere
Copy link
Member
@codebytere codebytere commented Mar 9, 2020

Description of Change

Closes #22554.

Adds a new optional force parameter to app.focus(), which allows for apps to make themselves active even if other apps are active.

cc @MarshallOfSound @nornagon @ckerr

Checklist

Release Notes

Notes: Add a new force parameter to app.focus() on macOS to allow apps to forcefully take focus.

< 10000 div data-view-component="true" class="TimelineItem-badge">
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Mar 9, 2020
@codebytere codebytere force-pushed the add-force-focus branch 2 times, most recently from 3619d7f to a707f66 Compare March 9, 2020 18:27
@codebytere codebytere force-pushed the add-force-focus branch 2 times, most recently from 5578605 to 375d6ff Compare March 9, 2020 19:09
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Mar 10, 2020
Copy link
Member
@ckerr ckerr left a comment

Choose a reason for hiding this comment

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

Thanks for the changes!

@codebytere codebytere merged commit b724fbc into master Mar 11, 2020
@release-clerk
Copy link
release-clerk bot commented Mar 11, 2020

Release Notes Persisted

Add a new force parameter to app.focus() on macOS to allow apps to forcefully take focus.

@trop
Copy link
Contributor
trop bot commented May 7, 2020

@ckerr has manually backported this PR to "9-x-y", please check out #23447

codebytere added a commit that referenced this pull request May 7, 2020
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
@sofianguy
< 8000 clipboard-copy aria-label="Copy link" for="issuecomment-625864842-permalink" role="menuitem" data-view-component="true" class="dropdown-item btn-link"> Copy link
Contributor

this was approved by the Releases WG on 5/6. removing pending-vote label

ckerr added a commit that referenced this pull request May 13, 2020
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
@trop
Copy link
Contributor
trop bot commented May 13, 2020

@ckerr has manually backported this PR to "8-x-y", please check out #23574

@Goldiserv
Copy link
Goldiserv commented Aug 25, 2022

I had this issue after opening a separate chrome/firefox browser instance.

Solution's a bit hacky but works for me:

ipcMain.handle('focus', () => {
      // mainWindow?.moveTop(); // doesn't work
      mainWindow?.setAlwaysOnTop(true);
      mainWindow?.setAlwaysOnTop(false);
      mainWindow?.focus();
});

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.

app.focus() not working
6 participants
0