Skip to content

Fix top-right corner close targets#361

Open
aladin7 wants to merge 1 commit into
Ruben2776:devfrom
aladin7:fix/320-titlebar-corner-click
Open

Fix top-right corner close targets#361
aladin7 wants to merge 1 commit into
Ruben2776:devfrom
aladin7:fix/320-titlebar-corner-click

Conversation

@aladin7

@aladin7 aladin7 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make the top-right corner a reliable close target for the Windows main window in normal, maximized, and fullscreen states
  • apply the same behavior consistently to PicView's Windows dialog windows
  • preserve Avalonia close-button hover semantics while handling the outermost corner with DPI-, monitor-, and taskbar-aware Win32 hit testing
  • cancel a pending close when the pointer is dragged away, and avoid closing when a drag only ends in the corner

Root cause

PicView uses custom Avalonia window chrome, and the outermost top-right pixel was outside the effective close target in several window states and dialogs. The native system Close command is disabled for this custom chrome, so returning the standard close hit-test value alone did not activate the close action.

Validation

  • dotnet build src/PicView.Avalonia.Win32/PicView.Avalonia.Win32.csproj -c Debug -p:Platform=x64 — succeeds with 0 errors
  • manually verified exact-corner closing in normal, maximized, fullscreen, and Settings windows
  • manually verified dragging from the corner outward does not close
  • manually verified dragging from outside into the corner does not close
  • git diff --check upstream/dev...HEAD

The repository's full test project is currently blocked by pre-existing stale test mocks and the .NET 11 VSTest/Microsoft Testing Platform mismatch; those files are not changed here.

Fixes #320

@aladin7
aladin7 force-pushed the fix/320-titlebar-corner-click branch 2 times, most recently from 3e459a3 to 9a2e81c Compare July 21, 2026 19:35
@aladin7
aladin7 force-pushed the fix/320-titlebar-corner-click branch from 9a2e81c to 1220173 Compare July 21, 2026 19:48
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.

Cannot casually hover the mouse over the top right corner and click to close

1 participant