Use internal IsVisible method
This commit is contained in:
parent
db79f4f450
commit
52801c4a41
3 changed files with 8 additions and 10 deletions
|
@ -205,7 +205,7 @@ NativeWindowViews::NativeWindowViews(
|
||||||
if (parent)
|
if (parent)
|
||||||
params.parent = parent->GetNativeWindow();
|
params.parent = parent->GetNativeWindow();
|
||||||
|
|
||||||
params.native_widget = new AtomDesktopNativeWidgetAura(window_.get(), this);
|
params.native_widget = new AtomDesktopNativeWidgetAura(window_.get());
|
||||||
atom_desktop_window_tree_host_win_ = new AtomDesktopWindowTreeHostWin(
|
atom_desktop_window_tree_host_win_ = new AtomDesktopWindowTreeHostWin(
|
||||||
this,
|
this,
|
||||||
window_.get(),
|
window_.get(),
|
||||||
|
|
|
@ -7,14 +7,15 @@
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
AtomDesktopNativeWidgetAura::AtomDesktopNativeWidgetAura(
|
AtomDesktopNativeWidgetAura::AtomDesktopNativeWidgetAura(
|
||||||
views::internal::NativeWidgetDelegate* delegate,
|
views::internal::NativeWidgetDelegate* delegate)
|
||||||
NativeWindowViews* window)
|
: views::DesktopNativeWidgetAura(delegate) {
|
||||||
: views::DesktopNativeWidgetAura(delegate),
|
|
||||||
window_(window) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomDesktopNativeWidgetAura::Activate() {
|
void AtomDesktopNativeWidgetAura::Activate() {
|
||||||
if (window_->IsVisible())
|
// Activate can cause the focused window to be blurred so only
|
||||||
|
// call when the window being activated is visible. This prevents
|
||||||
|
// hidden windows from blurring the focused window when created.
|
||||||
|
if (IsVisible())
|
||||||
views::DesktopNativeWidgetAura::Activate();
|
views::DesktopNativeWidgetAura::Activate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,15 +12,12 @@ namespace atom {
|
||||||
|
|
||||||
class AtomDesktopNativeWidgetAura : public views::DesktopNativeWidgetAura {
|
class AtomDesktopNativeWidgetAura : public views::DesktopNativeWidgetAura {
|
||||||
public:
|
public:
|
||||||
AtomDesktopNativeWidgetAura(views::internal::NativeWidgetDelegate* delegate,
|
AtomDesktopNativeWidgetAura(views::internal::NativeWidgetDelegate* delegate);
|
||||||
NativeWindowViews* window);
|
|
||||||
|
|
||||||
// internal::NativeWidgetPrivate:
|
// internal::NativeWidgetPrivate:
|
||||||
void Activate() override;
|
void Activate() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NativeWindowViews* window_;
|
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(AtomDesktopNativeWidgetAura);
|
DISALLOW_COPY_AND_ASSIGN(AtomDesktopNativeWidgetAura);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue