[PR #10486] [MERGED] wpf: fix the TerminalTheme struct to marshal the same on all platforms #28065

Open
opened 2026-01-31 09:26:06 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10486
Author: @DHowett
Created: 6/22/2021
Status: Merged
Merged: 6/22/2021
Merged by: @undefined

Base: mainHead: dev/duhowett/wpf/kaleidoscope


📝 Commits (1)

  • b7ab0f5 wpf: fix the TerminalTheme struct to be marshallable on all platforms

📊 Changes

3 files changed (+4 additions, -2 deletions)

View changed files

📝 src/cascadia/PublicTerminalCore/HwndTerminal.cpp (+1 -1)
📝 src/cascadia/PublicTerminalCore/HwndTerminal.hpp (+1 -1)
📝 src/cascadia/WpfTerminalTestNetCore/MainWindow.xaml.cs (+2 -0)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/10486 **Author:** [@DHowett](https://github.com/DHowett) **Created:** 6/22/2021 **Status:** ✅ Merged **Merged:** 6/22/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/duhowett/wpf/kaleidoscope` --- ### 📝 Commits (1) - [`b7ab0f5`](https://github.com/microsoft/terminal/commit/b7ab0f56199df99af879a04b73c58f6a5c506a7b) wpf: fix the TerminalTheme struct to be marshallable on all platforms ### 📊 Changes **3 files changed** (+4 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/PublicTerminalCore/HwndTerminal.cpp` (+1 -1) 📝 `src/cascadia/PublicTerminalCore/HwndTerminal.hpp` (+1 -1) 📝 `src/cascadia/WpfTerminalTestNetCore/MainWindow.xaml.cs` (+2 -0) </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:26:06 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28065