Merge pull request #1309 from hokein/workspace-visible-api

Add workspace visible APIs
This commit is contained in:
Cheng Zhao 2015-03-29 20:37:07 +08:00
commit 3b1be743ef
8 changed files with 68 additions and 0 deletions

View file

@ -692,6 +692,21 @@ void NativeWindowMac::ShowDefinitionForSelection() {
rwhv->ShowDefinitionForSelection();
}
void NativeWindowMac::SetVisibleOnAllWorkspaces(bool visible) {
NSUInteger collectionBehavior = [window_ collectionBehavior];
if (visible) {
collectionBehavior |= NSWindowCollectionBehaviorCanJoinAllSpaces;
} else {
collectionBehavior &= ~NSWindowCollectionBehaviorCanJoinAllSpaces;
}
[window_ setCollectionBehavior:collectionBehavior];
}
bool NativeWindowMac::IsVisibleOnAllWorkspaces() {
NSUInteger collectionBehavior = [window_ collectionBehavior];
return collectionBehavior & NSWindowCollectionBehaviorCanJoinAllSpaces;
}
bool NativeWindowMac::IsWithinDraggableRegion(NSPoint point) const {
if (!draggable_region_)
return false;