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
Ability to create Spotlight/Alfred like windows #4939
Comments
You can create a always-on-top hidden window, and then call |
@zcbenz Sadly this isn't what I meant. While this will keep the last app focused, I'm not able to type in my app anymore. Do you use a Mac? If you open Spotlight (Cmd + Space) you will be able to type into Spotlight (i.e it captures all keyboard and mouse events) while the last app is still shown as "focused" (maybe this isn't the right term to describe it). |
Hmm what you want should be a way to prevent window from being focused. |
Thanks for reopening :) Maybe OS X offers a standard way to implement those windows? It might be a possibility, since a bunch of 3rd party Mac apps (Alfred, 1PW Mini, …) have those windows. |
@zcbenz Any chance that this is coming to Electron soon? |
@florian app.hide() would meet your demand |
It has a similar behaviour and I also ended up using it. But it's not the exact same thing as the Spotlight/Alfred behaviour. |
#7296 is possibly related since it allows lots of different window levels. |
Hi @florian, it sounds like you have a workaround while this behavior isn't fully supported; are you happy with it? Would you be willing to share your solution? |
closing due to abandonment. |
Is not making progress on this really a reason to close the issue? I would still very much like to see this in Electron and apparently others are interested, too. |
Not sure how it could be implemented, but the key seems to be using NSPanel with NSNonactivatingPanelMask instead of NSWindow. |
We're trying to close out issues that haven't seen activity in some time and are not on our radars at the moment. If there's still some interest i can most definitely reopen :) |
I'm still interested in seeing better support for this style of window. I'm working around it right now ( |
Thanks a lot for reopening! :) |
Any updates so far? |
I tried a few things out with that feature the other day but I couldn't find a window level at which the underlying app keeps focus. |
I find that Any ideas please? |
See this issue too, i'm looking for the picture in picture functionality in macos |
Hey everyone, I just open sourced a module which in my testing allows creation of NSPanel windows on Mac (it's a no-op on other platforms right now). Take a look and let me know if it helps out – allows creation of a window that does not activate the application. |
@tommoor Awesome package! One issue I'm finding is that if I use So I'm still looking for a solution. I'm using electron v7 but can't find a way to make it work. |
Unfortunately it seems that the previous, library based solution (https://github.com/goabstract/electron-panel-window) does not work anymore : it segfaults right away when calling It is my impression that the only way to get this feature properly is to add it to electron, to spawn an actual proper |
@mefyl I agree that spawning |
I would love to see the ability to create Most other aspects of native window management are already available, or are at least possible to imitate, but this one does really does need a bit of help from the library before developers can run with it. |
Until this feature is added, a workaround you might consider is a library like At the moment, it looks like there's an open PR to stop propagation of keystrokes to whatever has the current focus, so it should be possible to intercept and then redirect input wherever you want it to go. I'm currently experimenting with this, and will be happy to update if anyone is interested. |
can any one update me on what is the current way to implement this |
Any updates? |
I'm closing this as it was implemented in #34388 👍 |
@clavin hey Clavin, there is currently no way to achieve spotlight, alfred like window with electron... |
Spotlight/Alfred (and other native apps like 1Password Mini) on Mac have a special behaviour, their windows are displayed above all other windows, but the last used app is still focused.
The closest I could find for Electron was the
alwaysOnTop
option, but it doesn't have the exact same behaviour.My Electron app has a Spotlight/Alfred like floating window and the visibility of the window can be toggled with a hotkey. However after hiding the window, the last used application doesn't get focused, which is pretty annoying for the user.
E.g. if I type a message in Skype, open the floating window to quickly look something up and then close it again, I won't be able to keep typing in Skype. I have to click on the Skype window before that. Spotlight/Alfred don't have that problem.
Is there any way to replicate this behaviour in Electron?
The text was updated successfully, but these errors were encountered: