Skip to content

Add AND-matching on process + window title for target window rules#170

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/enable-window-selection-by-process-title
Draft

Add AND-matching on process + window title for target window rules#170
Copilot wants to merge 2 commits intomasterfrom
copilot/enable-window-selection-by-process-title

Conversation

Copy link
Contributor

Copilot AI commented Mar 1, 2026

WindowConfig only supported matching on a single criterion (CommandLine, Path, or Title). This makes it impossible to scope a rule to a specific window of a process that opens multiple windows with different titles.

Changes

  • Config.cs: Extended WindowConfig with optional TitlePattern (string?) and TitlePatternType (WindowPatternType) properties. When TitlePattern is set alongside a process-based MatchType (CommandLine/Path), both conditions must match.

  • WindowMonitor.cs: TargetWindow now carries an optional TitleRegex; matching requires both the primary regex and the title regex (if present) to match.

  • MainViewModel.cs:

    • WindowConfigViewModel exposes TitlePattern, TitlePatternType, and IsTitlePatternVisible (hidden when MatchType == Title since that would be redundant).
    • FindWindow auto-populates TitlePattern from the selected window's title when the field is empty and the primary match type is not Title.
    • GetSaveConfig() persists both new fields.
  • MainWindow.xaml: Added a title pattern row to the target window item template (pattern-type selector + text input), visible only when IsTitlePatternVisible is true.

  • Resources: Added TitlePattern string (JP + EN).

Example config shape

{
  "MatchType": "Path",
  "PatternType": "Wildcard",
  "Pattern": "*\\MyApp.exe",
  "TitlePatternType": "Wildcard",
  "TitlePattern": "Editor - *"
}

This would only move/pin windows of MyApp.exe whose title starts with "Editor - ", leaving other windows of the same process unaffected.

Original prompt

This section details on the original issue you should resolve

<issue_title>操作対象のウィンドウをプロセスとウィンドウタイトル両方で判定できるようにする</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ability to determine target window by process and title Add AND-matching on process + window title for target window rules Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

操作対象のウィンドウをプロセスとウィンドウタイトル両方で判定できるようにする

2 participants