macos 在 Mac OS X 中将所有窗口移动到单个监视器(连接两个)?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39066/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 05:52:58  来源:igfitidea点击:

Move all windows to a single monitor (with two attached) in Mac OS X?

macosmultiple-monitors

提问by Will Robertson

Whenever I use my MacBook away from my desk and later plug it into an external display (as primary), I get into the state of having windows deposited in both the notebook monitor and the external one.

每当我在远离办公桌的地方使用 MacBook,然后将其插入外接显示器(作为主要显示器)时,我都会进入在笔记本显示器和外接显示器上都放置了窗口的状态。

To move all windows to a single screen, my current solution is to "Turn on mirroring" in the display preferences and then turn it off again. This is rather tedious, though. Does anyone know of a better way?

要将所有窗口移动到单个屏幕,我当前的解决方案是在显示首选项中“打开镜像”,然后再次将其关闭。不过,这相当乏味。有谁知道更好的方法?



I'm afraid the script posted by @erlandodoes absolutely nothing for me, running Mac OS X 10.5.4. (I.e., with windows on both screens, running the script moves not a single one of them, and it does not return any errors.) I guess I'll just have to stick with using the "mirror/unmirror" method mentioned above.

恐怕@erlando发布的脚本对运行 Mac OS X 10.5.4 的我毫无用处。(即,在两个屏幕上都有窗口,运行脚本不会移动其中一个,并且不会返回任何错误。)我想我只需要坚持使用上面提到的“镜像/取消镜像”方法。



@Denton: I'm afraid those links provide scripts for getting windows which are orphaned from anyscreen back onto the display. I ‘just' want to move all windows from a secondary display onto the primary display.

@ Denton:恐怕这些链接提供了脚本,用于将孤立于任何屏幕的窗口重新显示到显示器上。我“只是”想将所有窗口从辅助显示器移动到主显示器上。

回答by failrat

Cmd+F1appears to be a Mirror Displays shortcut in Snow Leopard. Don't know about Lion, etc, though.

Cmd+F1似乎是 Snow Leopard 中的 Mirror Displays 快捷方式。不知道狮子等,虽然。

Just tap it twice and see what happens (-:

只需轻按两次,看看会发生什么(-:

For the people who prefer to set up their function keys to act in the old-fashioned way (not as brightness/sound controls etc.), it will be Cmd+Fn+F1

对于喜欢将功能键设置为以老式方式(而不是亮度/声音控制等)操作的人来说,这将是 Cmd+Fn+F1

回答by Ben B

On Lion you can toggle Mirror Displays using fn+Cmd+F1(provided you are using the media control keys as default).

在 Lion 上,您可以使用fn+ Cmd+切换镜像显示F1(前提是您默认使用媒体控制键)。

This also works on Snow Leopard and likely everything in between, also possibly further back.

这也适用于雪豹和可能介于两者之间的所有内容,也可能更早。

回答by Jesús A. álvarez

You can click the "Gather Windows" button in the Displays preference pane.

您可以单击“显示”首选项窗格中的“收集 Windows”按钮。

回答by Jo Liss

As you said, the best answer seems to be turning "Mirror Displays" on and off again. Afterwards, all windows will have been collected on the main screen, and the secondary screen will be empty.

正如您所说,最好的答案似乎是再次打开和关闭“镜像显示”。之后,主屏幕上的所有窗口都将被收集,副屏幕将是空的。

screenshot

截屏

This is a bit cumbersome, but nothing else has worked for me in Lion.

这有点麻烦,但在 Lion 中没有其他任何东西对我有用。

回答by erlando

Here is a command-line script to do just that: http://zach.in.tu-clausthal.de/software/.

这是一个用于执行此操作的命令行脚本:http: //zach.in.tu-clausthal.de/software/

It's a little down the page under "Move Off-Screen Windows to the Main Screen".

它位于“将屏幕外窗口移动到主屏幕”下的页面下方。

回答by DGentry

There is an article on using AppleScript to do this at macosxtips.co.uk, and another at macosxhints.com.

有关于使用AppleScript在执行此操作的文章macosxtips.co.uk,另一个位于macosxhints.com