Just use visible state in CanFocus delegate
This commit is contained in:
parent
86007fe61d
commit
bda8af8dd3
4 changed files with 4 additions and 11 deletions
|
@ -149,8 +149,7 @@ NativeWindowViews::NativeWindowViews(
|
||||||
resizable_(true),
|
resizable_(true),
|
||||||
maximizable_(true),
|
maximizable_(true),
|
||||||
minimizable_(true),
|
minimizable_(true),
|
||||||
fullscreenable_(true),
|
fullscreenable_(true) {
|
||||||
focusable_(true) {
|
|
||||||
options.Get(options::kTitle, &title_);
|
options.Get(options::kTitle, &title_);
|
||||||
options.Get(options::kAutoHideMenuBar, &menu_bar_autohide_);
|
options.Get(options::kAutoHideMenuBar, &menu_bar_autohide_);
|
||||||
|
|
||||||
|
@ -198,7 +197,8 @@ NativeWindowViews::NativeWindowViews(
|
||||||
if (transparent() && !has_frame())
|
if (transparent() && !has_frame())
|
||||||
params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE;
|
params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE;
|
||||||
|
|
||||||
if (options.Get(options::kFocusable, &focusable_) && !focusable_)
|
bool focusable;
|
||||||
|
if (options.Get(options::kFocusable, &focusable) && !focusable)
|
||||||
params.activatable = views::Widget::InitParams::ACTIVATABLE_NO;
|
params.activatable = views::Widget::InitParams::ACTIVATABLE_NO;
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
|
@ -806,7 +806,6 @@ void NativeWindowViews::SetContentProtection(bool enable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindowViews::SetFocusable(bool focusable) {
|
void NativeWindowViews::SetFocusable(bool focusable) {
|
||||||
focusable_ = focusable;
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
LONG ex_style = ::GetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE);
|
LONG ex_style = ::GetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE);
|
||||||
if (focusable)
|
if (focusable)
|
||||||
|
|
|
@ -130,7 +130,6 @@ class NativeWindowViews : public NativeWindow,
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
TaskbarHost& taskbar_host() { return taskbar_host_; }
|
TaskbarHost& taskbar_host() { return taskbar_host_; }
|
||||||
bool CanFocus();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -263,7 +262,6 @@ class NativeWindowViews : public NativeWindow,
|
||||||
bool maximizable_;
|
bool maximizable_;
|
||||||
bool minimizable_;
|
bool minimizable_;
|
||||||
bool fullscreenable_;
|
bool fullscreenable_;
|
||||||
bool focusable_;
|
|
||||||
std::string title_;
|
std::string title_;
|
||||||
gfx::Size widget_size_;
|
gfx::Size widget_size_;
|
||||||
|
|
||||||
|
|
|
@ -202,8 +202,4 @@ void NativeWindowViews::HandleSizeEvent(WPARAM w_param, LPARAM l_param) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NativeWindowViews::CanFocus() {
|
|
||||||
return focusable_ && IsVisible();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -14,7 +14,7 @@ AtomDeskopNativeWidgetAura::AtomDeskopNativeWidgetAura(
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AtomDeskopNativeWidgetAura::CanFocus() {
|
bool AtomDeskopNativeWidgetAura::CanFocus() {
|
||||||
return window_->CanFocus();
|
return window_->IsVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue