terminal/.github
Dustin L. Howett (MSFT) 214163ebb7
Replace the HRGN-based titlebar cutout with an overlay window (#5485)
Also known as "Kill HRGN II: Kills Regions Dead (#5485)"

Copying the description from @greg904 in #4778.

--- 8< ---
My understanding is that the XAML framework uses another way of getting
mouse input that doesn't work with `WM_SYSCOMMAND` with `SC_MOVE`. It
looks like it "steals" our mouse messages like `WM_LBUTTONDOWN`.

Before, we were cutting (with `HRGN`s) the drag bar part of the XAML
islands window in order to catch mouse messages and be able to implement
the drag bar that can move the window. However this "cut" doesn't only
apply to input (mouse messages) but also to the graphics so we had to
paint behind with the same color as the drag bar using GDI to hide the
fact that we were cutting the window.

The main issue with this is that we have to replicate exactly the
rendering on the XAML drag bar using GDI and this is bad because:
1. it's hard to keep track of the right color: if a dialog is open, it
   will cover the whole window including the drag bar with a transparent
   white layer and it's hard to keep track of those things.
2. we can't do acrylic with GDI

So I found another method, which is to instead put a "drag window"
exactly where the drag bar is, but on top of the XAML islands window (in
Z order). I've found that this lets us receive the `WM_LBUTTONDOWN`
messages.
--- >8 ---

Dustin's notes: I've based this on the implementation of the input sink
window in the UWP application frame host.

Tested manually in all configurations (debug, release) with snap,
drag, move, double-click and double-click on the resize handle. Tested
at 200% scale.

Closes #4744
Closes #2100
Closes #4778 (superseded.)
2020-04-24 15:22:40 -07:00
..
actions/spell-check Replace the HRGN-based titlebar cutout with an overlay window (#5485) 2020-04-24 15:22:40 -07:00
ISSUE_TEMPLATE doc: Remove default issue titles (#2999) 2019-10-01 16:49:30 -07:00
workflows ci: spelling: update to 0.0.15a; update whitelist (#5413) 2020-04-21 14:07:04 -07:00
PULL_REQUEST_TEMPLATE.md Add explicit "validation steps" to PR template (#1140) 2019-06-04 21:19:32 +00:00