I'm trying to get a mac app to open on the current desktop when I use a a global keyboard shortcut (that I've overriden manually in the app). However, when I perform the keyboard shortcut, my desktop switches and shows me the app on the desktop it was previously on instead of the current one. The app is active, but on that other desktop.
Currently, I'm calling:
window?.makeKeyAndOrderFront(nil)
NSApplication.shared.activate(ignoringOtherApps: true)
Thanks in advance for the help.
In Interface Builder, select the window in question, and in the Attributes Inspector, change Spaces from Inferred Behavior to Move To Active Space.
That should allow the window to be shown on the currently active space rather than switching back to whichever space it was shown on last.
You can also do this programmatically by modifying the window's collectionBehavior:
window.collectionBehavior.insert(.moveToActiveSpace)
Related
I have VS Code 1.15.1 and when I work at two projects at once, I choose File -> New Window and open the second project. Clicking File -> New Window opens new window with VS Code.
On my other computer (not sure about the VS Code version there), when I click File -> New Window, instead of opening new window, it will rather open new tab, so that I end up with two tabs in one window, each tab for one project and the active tab occupies whole screen estate.
Any ideas what should I change in Settings to achieve this "single window, multiple tabs" layout when having multiple projects?
I use macos (not sure if OS may be somehow related to the window management settings)
Go to Preferences > Settings.
Search for native tabs
Check the checkbox
Code will prompt for restart to take effect.
After restart, make sure you have multiple projects open. And then merge all windows as shown below:
Enjoy multiple tabs in single window.
Note: I think this applies to all Mac OS >= Sierra. Tested with Catalina, Big Sur recently.
Just set in your user settings
"window.nativeTabs": true
and do Window -> Merge All Windows
note: If you have High Sierra installed, that might be an issue.
Here's the link:
Better macOS native window tabs support
In Mac OS, there is a system setting outside of VS Code. Set this and then opening files/folders from the command line will also automatically open the file/folder in a new tab instead of a new window.
In MacOS 12.3 (Monterrey) this is under:
System Preferences > General > Prefer tabs ____ when opening documents.
Change this setting to always. (The default is in full
screen).
You might additionally need to set the setting in VS Code "window.nativeTabs": true as the other commenters have already suggested.
I undocked the dev-Tools of chrome so that when pressing F12, another window opens, showing the DEV-Tools.
Problem: For I-don't-know-what-reason the window moves to a random position whenever it's opened. currently it moved so far, that its coordinates are fully outside of my desktop. It always moves at least somewhere nearly outside my desktop.
Question: How to restore the window positioni if it's not reachable for grabbing?
How to avoid this happening again?
I had the same problem, turns out it was because I had multiple monitors and one of them had display scaling set to 125%, when I set it back to 100% the developer tools windows always appeared where I could see it entirely.
You can change the display scaling by right clicking the desktop and then clicking Display settings, look for the setting Change the size of text, apps, and other items, if it's already at 100%, click on another monitor at the top and check again.
Of course you might not like having the monitor at 100% scaling (everything will be smaller), but at least it works!
I am developing a menu bar application for os x. I am using NSPopover to create a popup window.
However when some other application is full screen that popup is not visible. What settings should be set, so that popup window is always on top.
I struggled with this as well. When I had this problem, I created a invisible window that would flow above all other windows, including full screen ones. The window would then activate the popover.
However, I found a much cleaner solution here.
I just installed Eclipse from the Android website and the dialogs have no title bar and seem to be docked at the top of the Eclipse main window. I can't find a way to move them or get the titlebar back. I'm using Gnome 3 as desktop/window manager.
For example, if I choose Search | File... from the main menu, it comes up, but without titlebar. If I press Alt+F7, I can move the entire window, but the dialog will not move relative to the window.
How do I fix this?
Thx.
You are missing an important information, your operating system and desktop environment. Let me guess? Linux/Gnome? Or Cinnamon?
Gnome has the, erm, great feature to attach modal dialogs at the main window.
You can install dconf-editor and set the key org/gnome/shell/overrides/attach-modal-dialogs to false.
In Cinnamon you can easily disable this feature in the System Settings > Windows > Attach dialog windows (may not be the actual text as I translated it from my locale). You need to switch the settings to Expert mode to see the Windows entry.
I just found out how to have help open and the code editor open at the same time from an answer to this question: Opening Xcode help file and application at the same time
In Windows, Alt+Tab switched me back and forth to my hearts content. Here, Alt tab bring up the next open application (happens to be Firefox in my case).
How do I switch between the Xcode window and the help window?
Cmd+` and Cmd+Shift+` will switch back and forth between windows within a Mac application.
You can also use F10 to see all of the application's windows in a zoomed out view and pick one to focus with the mouse or keyboard.