mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-16 00:49:32 +08:00
Fix focus calls when window is disabled or minimised.
Fixes #3759 and #4168
This commit is contained in:
parent
d658ddd8b4
commit
b90c815ee9
@ -788,6 +788,14 @@ func (w *windowsWebviewWindow) setFullscreenButtonEnabled(_ bool) {
|
|||||||
|
|
||||||
func (w *windowsWebviewWindow) focus() {
|
func (w *windowsWebviewWindow) focus() {
|
||||||
w32.SetForegroundWindow(w.hwnd)
|
w32.SetForegroundWindow(w.hwnd)
|
||||||
|
|
||||||
|
if w.isDisabled() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if w.isMinimised() {
|
||||||
|
w.unminimise()
|
||||||
|
}
|
||||||
|
|
||||||
w.focusingChromium = true
|
w.focusingChromium = true
|
||||||
w.chromium.Focus()
|
w.chromium.Focus()
|
||||||
w.focusingChromium = false
|
w.focusingChromium = false
|
||||||
@ -1041,6 +1049,11 @@ func (w *windowsWebviewWindow) disableIcon() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (w *windowsWebviewWindow) isDisabled() bool {
|
||||||
|
style := uint32(w32.GetWindowLong(w.hwnd, w32.GWL_STYLE))
|
||||||
|
return style&w32.WS_DISABLED != 0
|
||||||
|
}
|
||||||
|
|
||||||
func (w *windowsWebviewWindow) updateTheme(isDarkMode bool) {
|
func (w *windowsWebviewWindow) updateTheme(isDarkMode bool) {
|
||||||
|
|
||||||
if w32.IsCurrentlyHighContrastMode() {
|
if w32.IsCurrentlyHighContrastMode() {
|
||||||
|
Loading…
Reference in New Issue
Block a user