feat: add BrowserWindow.isFocusable() (#28642)
This commit is contained in:
parent
69f3e330e7
commit
11199d8824
11 changed files with 52 additions and 0 deletions
|
@ -1087,6 +1087,17 @@ void NativeWindowViews::SetFocusable(bool focusable) {
|
|||
#endif
|
||||
}
|
||||
|
||||
bool NativeWindowViews::IsFocusable() {
|
||||
bool can_activate = widget()->widget_delegate()->CanActivate();
|
||||
#if defined(OS_WIN)
|
||||
LONG ex_style = ::GetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE);
|
||||
bool no_activate = ex_style & WS_EX_NOACTIVATE;
|
||||
return !no_activate && can_activate;
|
||||
#else
|
||||
return can_activate;
|
||||
#endif
|
||||
}
|
||||
|
||||
void NativeWindowViews::SetMenu(ElectronMenuModel* menu_model) {
|
||||
#if defined(USE_X11)
|
||||
if (!features::IsUsingOzonePlatform()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue