mirror of
https://github.com/electron/electron.git
synced 2026-01-08 23:18:06 -05:00
fix: Windows: Calling window.setFocusable(true) will no longer cause a window to lose focus (#48927)
Make setFocusable only deactivate a window if focusable is false. Do not deactivate a window when setting focusable to true. Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: vulture <isu@vulture.fm>
This commit is contained in:
@@ -1363,7 +1363,8 @@ void NativeWindowViews::SetFocusable(bool focusable) {
|
||||
ex_style |= WS_EX_NOACTIVATE;
|
||||
::SetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE, ex_style);
|
||||
SetSkipTaskbar(!focusable);
|
||||
Focus(false);
|
||||
if (!focusable)
|
||||
Focus(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user