Add focusable option

This commit is contained in:
Cheng Zhao 2016-06-13 17:10:28 +09:00
parent 5aecd10502
commit 8eca728e0a
11 changed files with 24 additions and 23 deletions

View file

@ -490,6 +490,10 @@ NativeWindowMac::NativeWindowMac(
NSWindowCollectionBehaviorIgnoresCycle)];
}
bool focusable;
if (options.Get(options::kFocusable, &focusable) && !focusable)
[window_ setDisableKeyOrMainWindow:YES];
// Remove non-transparent corners, see http://git.io/vfonD.
if (!has_frame())
[window_ setOpaque:NO];
@ -883,10 +887,6 @@ void NativeWindowMac::SetIgnoreMouseEvents(bool ignore) {
[window_ setIgnoresMouseEvents:ignore];
}
void NativeWindowMac::SetIgnoreFocus(bool ignore) {
[window_ setDisableKeyOrMainWindow:ignore];
}
bool NativeWindowMac::HasModalDialog() {
return [window_ attachedSheet] != nil;
}