Page 1 of 1

[confirmed]show_deck() cancel display on windows 10

PostPosted: 20 Jun 2019, 13:07
by Korath
Summary:
show_deck() dialog on Windows 10:

Expected:
Image

Actual:
Image

Version:
Current dev master.

Discussion:
Split from Etherwrought Page card on bottom instead of gy. I'm almost certain it was separately reported elsewhere, but I can't find it.

Short version: WM_NCPAINT is voodoo, even in the context of w32api.

What's going on under the hood here is that the show_deck() dialog lets Windows paint itself as normal, then paints over the dialog's caption (and borders, but that's unimportant) so it can have a minimal, fugly "Cancel"/"Done"/"Into grave?" button in the upper right. This works just fine in Windows 95, 98, XP, and Vista with Aero turned off. In Windows 10 (and likely 8.1, 8, 7, and Vista with Aero on), neither the caption nor borders are drawn.

What I think the problem is is that, at some point, the default handler for WM_NCPAINT began clearing the clipping region. Calling the default handler, and then doing more stuff afterwards like this dialog does, is probably undefined behavior, but WM_NCPAINT is, for all purposes, totally undocumented by Microsoft anyway. Omitting the call to the default handler almost does what we want, but doesn't draw the scroll bar. Passing the default handler a new clipping region - even a copy of the same clipping region as it was getting before - seems to do what we want. So does passing it a null clipping region, which is what I'm currently doing in Shandalar.

Also, the fugly text-only button could use a right margin of 5px or so, to match the left margin on the primary text in the upper left.

Re: show_deck() cancel display on windows 10

PostPosted: 23 Jun 2019, 10:28
by travolter
Related bug here casting Mind Bomb. I dont want to discard any card and the cancel button is missing (at least the grey border around the cards works as cancel

Re: show_deck() cancel display on windows 10

PostPosted: 23 Jun 2019, 13:10
by Korath
Not a related bug; it's the same bug.