Skip to content

fix(windows/v3): HiddenOnTaskbar blocks keyboard focus; layered window hit-test region frozen after resize#5010

Draft
Copilot wants to merge 381 commits intov3-alphafrom
copilot/fix-issues-from-discussion-5001
Draft

fix(windows/v3): HiddenOnTaskbar blocks keyboard focus; layered window hit-test region frozen after resize#5010
Copilot wants to merge 381 commits intov3-alphafrom
copilot/fix-issues-from-discussion-5001

Conversation

Copy link
Contributor

Copilot AI commented Feb 22, 2026

Two Windows-specific bugs identified in discussion #5001.

Description

Bug 1 — HiddenOnTaskbar: true blocks all keyboard input

WS_EX_NOACTIVATE was used instead of WS_EX_TOOLWINDOW. WS_EX_NOACTIVATE prevents window activation entirely — blocking keyboard focus and input. WS_EX_TOOLWINDOW is the correct style to hide from the taskbar.

Bug 2 — Frameless+transparent window hit-test region frozen at creation size

On WS_EX_LAYERED windows, Windows fixes the hit-testable region at CreateWindowEx time. SetWindowPos alone does not update it — after resize, the expanded area is permanently click-through.

Fix: call SetLayeredWindowAttributes(hwnd, 0, 255, LWA_ALPHA) after each SetWindowPos in setPhysicalBounds() to refresh the layered region.

// Before (broken):
if options.Windows.HiddenOnTaskbar {
    //exStyle |= w32.WS_EX_TOOLWINDOW  // correct but commented out
    exStyle |= w32.WS_EX_NOACTIVATE    // blocks keyboard focus
}

// After:
if options.Windows.HiddenOnTaskbar {
    exStyle |= w32.WS_EX_TOOLWINDOW
}

Changed files:

  • v3/pkg/application/webview_window_windows.go — fix HiddenOnTaskbar style; call SetLayeredWindowAttributes after SetWindowPos in setPhysicalBounds()
  • v3/pkg/w32/user32.go — add SetLayeredWindowAttributes wrapper
  • v3/pkg/w32/constants.go — add LWA_ALPHA and LWA_COLORKEY constants

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Cross-compiled with GOOS=windows GOARCH=amd64 go build ./pkg/w32/... ./pkg/application/... — builds clean. Runtime validation requires Windows with a frameless+transparent window.

  • Windows
  • macOS
  • Linux

Test Configuration

Linux CI only; Windows runtime testing required by reviewer.

Checklist:

  • I have updated v3/UNRELEASED_CHANGELOG.md with details of this PR
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

leaanthony and others added 30 commits March 3, 2025 21:32
- Replace SW_RESTORE with SW_SHOW flag
- Resolves #4109
(cherry picked from commit fe6635c)
add -skipembedcreate cli option to improve recompile time
github-actions bot and others added 12 commits February 2, 2026 18:40
Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com>
…4921)

* feat(v2): add runtime.ResetSignalHandlers() for Linux panic recovery

Add a new runtime function that allows users to reset signal handlers
before code that might panic from nil pointer dereferences.

On Linux, WebKit installs signal handlers without the SA_ONSTACK flag,
which prevents Go from properly recovering from panics caused by
SIGSEGV and other signals. This function adds SA_ONSTACK to the
relevant signal handlers (SIGSEGV, SIGBUS, SIGFPE, SIGABRT).

Usage:
```go
go func() {
    defer func() {
        if err := recover(); err != nil {
            log.Printf("Recovered: %v", err)
        }
    }()
    runtime.ResetSignalHandlers()
    // Code that might panic...
}()
```

The function is a no-op on macOS and Windows.

Fixes #3965

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(v2): add panic-recovery-test example

Add an example that demonstrates the Linux signal handler issue (#3965)
and verifies the fix using runtime.ResetSignalHandlers().

The example includes:
- A Greet function that triggers a nil pointer dereference after a delay
- Auto-call from frontend after 5 seconds
- README with reproduction steps

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix(v2): prevent wails init in non-empty directory with -d flag

When using -d to specify a target directory, wails init now checks if
the directory is non-empty and errors if so. This prevents accidental
data loss (e.g., overwriting .git directories).

Fixes #4940

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(v2): add tests for init non-empty directory check

Add tests to verify:
- Install fails when target directory is non-empty
- Install succeeds when target directory is empty

Also update changelog with the fix.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There's been a ton of improvements in the `ghw` library since the
v0.13.0 release, including the update of certain transitive dependencies
around Windows and Darwin support libraries.

This patch simply brings in those improvements. The `v0.21.3` release of
`ghw` is fully backwards-compatible with `v0.13.0`.

Signed-off-by: Jay Pipes <jaypipes@gmail.com>
Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com>
Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com>
* "Claude PR Assistant workflow"

* "Claude Code Review workflow"
Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com>
Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com>
Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com>
Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com>
Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 22, 2026

Deploying wails with  Cloudflare Pages  Cloudflare Pages

Latest commit: a524c67
Status: ✅  Deploy successful!
Preview URL: https://c45de5f8.wails.pages.dev
Branch Preview URL: https://copilot-fix-issues-from-disc.wails.pages.dev

View logs

…d layered window hit-test region

Co-authored-by: leaanthony <1943904+leaanthony@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues identified in discussion 5001 fix(windows/v3): HiddenOnTaskbar blocks keyboard focus; layered window hit-test region frozen after resize Feb 22, 2026
Copilot AI requested a review from leaanthony February 22, 2026 05:33
@leaanthony leaanthony changed the base branch from master to v3-alpha February 22, 2026 06:15
Copilot AI added 2 commits February 22, 2026 06:20
…3-alpha content

This cleanup commit resolves the issue where the branch was accidentally
based on master instead of v3-alpha. It removes all master-specific files,
restores any v3-alpha files to their correct state, and ensures only the
3 intended bugfix changes differ from v3-alpha:
- v3/pkg/application/webview_window_windows.go
- v3/pkg/w32/constants.go
- v3/pkg/w32/user32.go
@semgrep-code-wailsapp
Copy link

Semgrep found 1 ssc-cee3e6d5-d7c8-4c35-9815-076aa1ebfd49 finding:

  • v3/examples/dev/frontend/package-lock.json

Risk: Affected versions of rollup are vulnerable to Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

Manual Review Advice: A vulnerability from this advisory is reachable if you use Rollup to bundle JavaScript with import.meta.url and the output format is set to cjs, umd, or iife formats, while allowing users to inject scriptless HTML elements with unsanitized name attributes

Fix: Upgrade this library to at least version 3.29.5 at wails/v3/examples/dev/frontend/package-lock.json:569.

Reference(s): GHSA-gcx4-mw62-g8wm, CVE-2024-47068

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.