On Windows focusable: false also means skipTaskbar: true
This commit is contained in:
parent
8eca728e0a
commit
50f1837097
3 changed files with 14 additions and 7 deletions
|
@ -181,6 +181,10 @@ NativeWindowViews::NativeWindowViews(
|
|||
if (transparent() && !has_frame())
|
||||
params.shadow_type = views::Widget::InitParams::SHADOW_TYPE_NONE;
|
||||
|
||||
bool focusable;
|
||||
if (options.Get(options::kFocusable, &focusable) && !focusable)
|
||||
params.activatable = views::Widget::InitParams::ACTIVATABLE_NO;
|
||||
|
||||
#if defined(OS_WIN)
|
||||
params.native_widget =
|
||||
new views::DesktopNativeWidgetAura(window_.get());
|
||||
|
@ -696,10 +700,12 @@ void NativeWindowViews::SetFocusable(bool focusable) {
|
|||
#if defined(OS_WIN)
|
||||
LONG ex_style = ::GetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE);
|
||||
if (focusable)
|
||||
ex_style |= WS_EX_NOACTIVATE;
|
||||
else
|
||||
ex_style &= ~WS_EX_NOACTIVATE;
|
||||
else
|
||||
ex_style |= WS_EX_NOACTIVATE;
|
||||
::SetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE, ex_style);
|
||||
SetSkipTaskbar(!focusable);
|
||||
Focus(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue