Implement Activate instead of CanFocus
This commit is contained in:
parent
bda8af8dd3
commit
db79f4f450
3 changed files with 10 additions and 9 deletions
|
@ -205,7 +205,7 @@ NativeWindowViews::NativeWindowViews(
|
|||
if (parent)
|
||||
params.parent = parent->GetNativeWindow();
|
||||
|
||||
params.native_widget = new AtomDeskopNativeWidgetAura(window_.get(), this);
|
||||
params.native_widget = new AtomDesktopNativeWidgetAura(window_.get(), this);
|
||||
atom_desktop_window_tree_host_win_ = new AtomDesktopWindowTreeHostWin(
|
||||
this,
|
||||
window_.get(),
|
||||
|
|
|
@ -6,15 +6,16 @@
|
|||
|
||||
namespace atom {
|
||||
|
||||
AtomDeskopNativeWidgetAura::AtomDeskopNativeWidgetAura(
|
||||
AtomDesktopNativeWidgetAura::AtomDesktopNativeWidgetAura(
|
||||
views::internal::NativeWidgetDelegate* delegate,
|
||||
NativeWindowViews* window)
|
||||
: views::DesktopNativeWidgetAura(delegate),
|
||||
window_(window) {
|
||||
}
|
||||
|
||||
bool AtomDeskopNativeWidgetAura::CanFocus() {
|
||||
return window_->IsVisible();
|
||||
void AtomDesktopNativeWidgetAura::Activate() {
|
||||
if (window_->IsVisible())
|
||||
views::DesktopNativeWidgetAura::Activate();
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -10,18 +10,18 @@
|
|||
|
||||
namespace atom {
|
||||
|
||||
class AtomDeskopNativeWidgetAura : public views::DesktopNativeWidgetAura {
|
||||
class AtomDesktopNativeWidgetAura : public views::DesktopNativeWidgetAura {
|
||||
public:
|
||||
AtomDeskopNativeWidgetAura(views::internal::NativeWidgetDelegate* delegate,
|
||||
AtomDesktopNativeWidgetAura(views::internal::NativeWidgetDelegate* delegate,
|
||||
NativeWindowViews* window);
|
||||
|
||||
// aura::WindowDelegate
|
||||
bool CanFocus() override;
|
||||
// internal::NativeWidgetPrivate:
|
||||
void Activate() override;
|
||||
|
||||
private:
|
||||
NativeWindowViews* window_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomDeskopNativeWidgetAura);
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomDesktopNativeWidgetAura);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue