Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wpf: fix the TerminalTheme struct to marshal the same on all platforms #10486

Merged
1 commit merged into from
Jun 22, 2021

Conversation

DHowett
Copy link
Member

@DHowett DHowett commented Jun 22, 2021

The CursorStyle enum is declared as being of type uint on the C# side,
but as size_t on the C++ side. There's a C# size_t impostor we could
use, System.UIntPtr, but I don't want to risk changing the public API of
TerminalTheme and I don't know if it can be used as a base type for an
enum.

Anyway, since we don't have more than four billion cursor types I chose
to narrow the field to a uint32_t and unpack it in TerminalSetTheme.

Fixes #10485

The CursorStyle enum is declared as being of type `uint` on the C# side,
but as `size_t` on the C++ side. There's a C# size_t impostor we could
use, System.UIntPtr, but I don't want to risk changing the public API of
TerminalTheme and I don't know if it can be used as a base type for an
enum value.

Anyway, since we don't have more than four billion cursor types I chose
to narrow the field to a uint32_t and unpack it in TerminalSetTheme.

Fixes #10485
@ghost ghost added the Area-WPFControl Things related to the WPF version of the TermControl label Jun 22, 2021
@DHowett DHowett requested a review from javierdlg June 22, 2021 16:05
@DHowett DHowett changed the title wpf: fix the TerminalTheme struct to be marshallable on all platforms wpf: fix the TerminalTheme struct to marshal the same on all platforms Jun 22, 2021
@DHowett DHowett added the Needs-Second It's a PR that needs another sign-off label Jun 22, 2021
@ghost ghost requested review from zadjii-msft and miniksa June 22, 2021 16:09
@DHowett
Copy link
Member Author

DHowett commented Jun 22, 2021

@msftbot merge this in 3 minutes

@ghost ghost added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jun 22, 2021
@ghost
Copy link

ghost commented Jun 22, 2021

Hello @DHowett!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Tue, 22 Jun 2021 16:13:16 GMT, which is in 3 minutes

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@ghost ghost merged commit 2770228 into main Jun 22, 2021
@ghost ghost deleted the dev/duhowett/wpf/kaleidoscope branch June 22, 2021 17:03
DHowett added a commit that referenced this pull request Jul 7, 2021
#10486)

The CursorStyle enum is declared as being of type `uint` on the C# side,
but as `size_t` on the C++ side. There's a C# size_t impostor we could
use, System.UIntPtr, but I don't want to risk changing the public API of
TerminalTheme and I don't know if it can be used as a base type for an
enum.

Anyway, since we don't have more than four billion cursor types I chose
to narrow the field to a uint32_t and unpack it in TerminalSetTheme.

Fixes #10485

(cherry picked from commit 2770228)
DHowett added a commit that referenced this pull request Jul 7, 2021
#10486)

The CursorStyle enum is declared as being of type `uint` on the C# side,
but as `size_t` on the C++ side. There's a C# size_t impostor we could
use, System.UIntPtr, but I don't want to risk changing the public API of
TerminalTheme and I don't know if it can be used as a base type for an
enum.

Anyway, since we don't have more than four billion cursor types I chose
to narrow the field to a uint32_t and unpack it in TerminalSetTheme.

Fixes #10485

(cherry picked from commit 2770228)
@ghost
Copy link

ghost commented Jul 14, 2021

🎉Windows Terminal v1.9.1942.0 has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link

ghost commented Jul 14, 2021

🎉Windows Terminal Preview v1.10.1933.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-WPFControl Things related to the WPF version of the TermControl AutoMerge Marked for automatic merge by the bot when requirements are met Needs-Second It's a PR that needs another sign-off
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wpf: color table is a kaleidoscope of misery in DotNet_x64Test configuration
3 participants