(Electron) How to open/close a window without making it the active application? - macos

Raycast is a perfect example of this. I can open the window with a global shortcut and type in it. When I open/close the window, the application in the top left (macos) doesn't change. How do I do this in electron?

Related

Use non-native fullscreen window mode in PhpStorm on macOS

How can I configure PhpStorm to use the "non-native" fullscreen mode? I'd like PhpStorm to be fullscreen (without the macOS top menu bar, etc), in the same window (without creating a new window that I have to scroll between).
The terminal for macOS iTerm2 have this setting. You can choose to remove the tick from "Native full screen windows". When this tick is removed, the fullscreen mode will simply take out all space in the window, without creating a new separate window.
Native fullscreen example
Notice how a new separate "window" is created called "PhpStorm"
Non-native fullscreen example
Notice how theres still one window called "Desktop". The iTerm window fills out the whole screen though.
the only way you can do it at the moment is by adjusting the dock in mac to hide menu automatically and then spread the editor to wider and higher setting
click right on the dock in mac and goto settings and hide menu works for me
i am suffering from same issue lol after i saw iterm2 :P

How can I specify on which monitor the console window is opened?

I've currently connected two monitors via a dock to my notebook.
When I'm running my console application, the console window always pops up on the first monitor. How can I change that it's automatically opened on another monitor, e.g. on monitor 3? Maybe there is a property I need to modify?
It's very annoying to always drag the console window onto the monitor on which my IDE is opened.
Console applications (unlike GUI applications) don't create their own window; that's done by Windows, and in the case when you're running in an already created console, then you kinda inherit, e.g., cmd's window.
What you can do, though, is to find your window and move it to a different monitor.
Another option is to change the window manager settings for that application in the properties of the console window under Layout. Especially the check box »Let system position window«. To do so, first move the window where you'd like it to appear, then open the properties, go to the Layout tab, and just click »OK«.

Is it possible to access the Diamond guide in Visual Studio from the keyboard only?

I have taken to participating in mouseless Monday's and Friday's. I have set my windows float and dock tabs to hotkeys that allow me to pull them out or put them back in; however, I want to be able to choose which location to put the tabbed document in. I operate in landscape mode so I regularly have a bottom and a top window in visual studio. I would like to press a hotkey and send the selected document to that part of the diamond guide. Anyone know a plugin or how I can do this?
There's an entire article dedicated to navigating the IDE using just the keyboard, with a section on docking windows and tabs using the diamond guide from the keyboard. So yes, it is possible, and you don't need a plugin for it:
To move and dock tool windows from the keyboard
Navigate to the tool window you intend to move and give it focus.
On the Window menu, click Dockable.
Press ALT + Space and then choose Move.
The docking guide diamond appears.
Use the ARROW keys to move the window to a new location.
The mouse pointer moves with the window as you use the ARROW keys.
When you have reached the new location, use the ARROW keys to move the mouse pointer over the correct portion of the guide diamond.
An outline of the tool window appears in the new docking location.
Press ENTER.
The tool window snaps into place at the new docking location.
Alternatively, you can cheat by simply controlling the mouse pointer with the keyboard, through a nifty system accessibility feature called MouseKeys.

trying to make an application can attach and detach a tab from window by drag and drop like google chrome web browser?

I'd like to make an application which user can drag and drop tab to make a new window contains
a tab control user holds. What i am looking for is the exact same functionality of Google
Chrome browser for window and Internet explorer 9. Both Applications create a new window if
if user drags and drop a tab out of original window. and vice versa.
How do i do this? Any advice or sample code will be appreciated
It's not a simple task, but if you work through it bit by bit...
Most tab controls will allow you to detect mousedown (and maybe even drag) and when the cursor is moved away from the tab row, you create a new window with a single tab (and maybe a frame depending on what you want).
When they drop, show the rest of the frame as required.
As for moving the content, this depends on your application layout but it can be as simple as changing the container of a control (SetParent()) or the destination of a render.
You can also just drag an "image" of the tab and only create the window when they drop.
Getting any more detail than this is going to be preety much impossible without specifics (and you actually accept an answer).

Accept mouse clicks without activating the application?

I am working on a utility application that controls other running applications. On certain input event my application displays a window, user can pick some operation from the window, the window disappears and control returns to the previous app. My problem is that clicking in my app’s window activates my application, thus removing focus from the previous application’s window. I can re-activate the previous application when my window closes, but I’d rather keep the original application activated all the time. Is that possible?
It's quite easy to to, just make your window an instance of NSPanel (a subclass of NSWindow), and set it as non-activating in Xcode/IB (or create it programatically, with NSNonactivatingPanelMask in the style mask).
One idea would be: while your app is running, try to keept track of the active window in the system.
After you activate your app and click the command button, restore the previous active window.
This is only an idea, I don't know how to do it on mac.

Resources