问题描述
我正在做一个自定义的窗口(一个NSWindow与NSBorderlessWindowMask)到目前为止,我已经能够处理拖动,调整大小,cmd +点击甚至小型化与双击如果允许(请参阅),所以我的窗口尽可能的像一个正常的NSWindow 。但是,当我将窗口拖到屏幕的一角时,用户会将该窗口移动到下一个空格。 (如果您在SystemPreferences>显示和空格>空格>启用空格中启用了空格)
我不知道如何更改为其他
最后我找到了一个解决方案。
我不能以编程方式改变到一定的空间,但我可以让我的窗口像其他非 NSBorderlessWindowMask
如果 [window setMovableByWindowBackground:YES ]
。这是这个问题的最终目的:)
解决方案在这里写入(有一些细节),因为这个问题似乎更老)
$ b $ b
I am making a customised window (a NSWindow with NSBorderlessWindowMask) So far I have been able to handle dragging, resizing, cmd+click and even miniaturize with double click if allowed (see here) so my window resembles as much as possible to a normal NSWindow.
However when I drag my window to the corner of my screen the user will expect to move that window to the next space. (In case you have Spaces enabled in "SystemPreferences" > "Expose and Spaces" > "Spaces" > "Enable Spaces")
I wonder how can I change to other space programmatically and move my window there?
Finally I found a solution.I can't change to a certain space programmatically but I can make my window behave like other non NSBorderlessWindowMask
if [window setMovableByWindowBackground:YES]
is done. That was the final purpose of this question :)
The solution is written (with some detail) here because that question seems to be older (or maybe a duplicate of this question?)
Is there a way to make a custom NSWindow work with Spaces
这篇关于以编程方式更改为其他空间(MacOSX)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!