6

A Mail window was in the Dock, and I clicked on it to restore it to my current Desktop. Instead of opening where I can see it, it went to some other Desktop, presumably the one it was in when it was minimized.

I use different Desktops for different projects, where one Desktop may have multiple browser windows, multiple text editors, etc., so I've disabled the default setting of "When switching to an application, switch to a Space with open windows for the application", because that seems to only make sense if you use an approach of one Space per Application, which makes no sense for me. As far as I can tell this is the only setting I'm using that may be relevant to this problem, but I really really don't want to have OS X forcing me to constantly switch spaces and force me into a one-space-per-app model.

Mission Control settings

Is there some way to make the window I restore (de-minimize) appear in my current Space/Desktop? It could be

  • a hidden preference that I set with defaults write;
  • an AppleScript that I have to trigger after restoring the window, to move it to my current Space/Desktop;
  • some utility application meant to handle this problem
  • some other workaround or solution I hadn't thought of.

(An AppleScript would probably be the least desirable approach, but it could be triggered with Alfred, QuicKeys, or BetterTouchTool, etc.)

It might also be worth mentioning that I'm using Yosemite because of problems between El Capitan and TotalSpaces2, but I'd like to know if upgrading solves this problem.

4

⌘ Command "click" on the minimized window in the dock, and it will restore (de-minimize) in the current workspace, regardless of which space it was on when it was minimized.

2
  • doesn't work if "Minimize windows into application icon" setting is enabled, but still upvoting this one.
    – victor
    Jul 16 '16 at 2:39
  • 2
    Is there any way to make this the default? I'd rather use command to put the window into "the background" (i.e. another space), much like command-clicking on a link puts the link into a background tab in a browser.
    – iconoclast
    Jul 18 '16 at 18:18
2

Possibly this helps your situation:

defaults write com.apple.Dock workspaces-auto-swoosh -bool NO; killall Dock
5
  • will this make it open in my current space, or just avoid switching spaces when it is restored?
    – iconoclast
    Feb 19 '16 at 3:08
  • somehow yes. It does not auto change to the space the window is opened again, which helps staying in context. you then can use the context menu in the dock to bring the window to this space. Feb 19 '16 at 13:56
  • Unfortunately it has a side effect. Now if I (e.g.) select a window from the Window menu, I do not switch to the space of that window.
    – iconoclast
    Feb 19 '16 at 15:15
  • Do I need to logout/login again? This doesn't work on macOS Catalina
    – muuvmuuv
    Nov 19 '19 at 7:39
  • Doesn't work in Catalina for me either Dec 13 '19 at 9:06
1

I managed to get this working with some help from koekeishiya's yabai.

First we disable the workspaces swoosh as @mahal tertin mentioned:

defaults write com.apple.Dock workspaces-auto-swoosh -bool NO; killall Dock

Then we add this bit of code to our .yabairc file:

yabai_query_current_space="\$(yabai -m query --spaces --space | jq '.index' )"
yabai -m signal --add event=window_deminimized action="yabai -m window $YABAI_WINDOW_ID --space $yabai_query_current_space"

Effectively, this instructs yabai to send a deminimizing window to the current space when it receives a deminimize event.

Depends on having yabai and jq installed.

ref: https://github.com/koekeishiya/yabai/blob/master/doc/yabai.asciidoc#signal

New contributor
pete-may is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
5
  • What's the location of the .yabairc file? Oct 14 at 23:18
  • 1
    I have mine in my $HOME directory. github.com/koekeishiya/yabai/wiki/…
    – pete-may
    Oct 15 at 0:29
  • 1
    I should also mention that if you don't want all the other cool features of yabai you can put yabai -m config layout float in your .yabairc file to basically disable the window tiling features.
    – pete-may
    Oct 15 at 0:30
  • great find! but "System Integrity Protection needs to be (partially) disabled for yabai to inject a scripting addition into Dock.app" scares me a little 😮
    – iconoclast
    Oct 15 at 21:08
  • I'm actually using it without the scripting addition! Most of the yabai features work without it. I'm on a work computer so got to have everything secure.
    – pete-may
    Oct 15 at 21:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .