How to get the window title of a process in C# on Linux/macOS?

Viewed 88

By default, GUI windows in Windows, Linux and macOS will show the title of the window on top of them and that is what I want to read programmatically with .NET Core 6.

On Windows, this can done by getting Process.MainWindowTitle. However, the documentation of that property states it will most often return an empty string on Unix system and so this what happens on Linux and macOS.

Is there a way to read this information on these systems? A native way to do so without dependencies would be preferred if possible.

1 Answers
Related