Skip to content

Commit

Permalink
[WtqWindow] Added window caption/title for tracking purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingpie committed Nov 23, 2024
1 parent a50c0e2 commit 6b9c43d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/10-Core/Wtq/WtqWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public abstract class WtqWindow
/// </summary>
public abstract string? Name { get; }

public abstract string? Title { get; }

public abstract Task BringToForegroundAsync();

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions src/20-Services/Wtq.Services.KWin/Dto/KWinWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ namespace Wtq.Services.KWin.Dto;

public class KWinWindow
{
[JsonPropertyName("caption")]
public string? Caption { get; set; }

[JsonPropertyName("frameGeometry")]
public KWinRectangle? FrameGeometry { get; set; }

Expand Down
2 changes: 2 additions & 0 deletions src/20-Services/Wtq.Services.KWin/KWinWtqWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class KWinWtqWindow(

public override string? Name => _window?.ResourceClass;

public override string? Title => _window?.Caption;

public override async Task BringToForegroundAsync()
{
await _kwinClient.BringToForegroundAsync(_window, CancellationToken.None).NoCtx();
Expand Down
1 change: 1 addition & 0 deletions src/20-Services/Wtq.Services.KWin/wtq.kwin.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ cmds["GET_WINDOW_LIST"] = (cmdInfo) => {
.getWindows()
.map(w => {
return {
caption: w.caption,
internalId: w.internalId,
resourceClass: w.resourceClass,
resourceName: w.resourceName
Expand Down
2 changes: 2 additions & 0 deletions src/20-Services/Wtq.Services.Win32/Win32WtqWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public sealed class Win32WtqWindow(

public override string? Name => _process.ProcessName;

public override string? Title => _process.MainWindowTitle;

public override Task BringToForegroundAsync()
{
User32.SetForegroundWindow(_process.MainWindowHandle);
Expand Down

0 comments on commit 6b9c43d

Please sign in to comment.