Add AND-matching on process + window title for target window rules#170
Draft
Add AND-matching on process + window title for target window rules#170
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WindowConfigonly 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: ExtendedWindowConfigwith optionalTitlePattern(string?) andTitlePatternType(WindowPatternType) properties. WhenTitlePatternis set alongside a process-basedMatchType(CommandLine/Path), both conditions must match.WindowMonitor.cs:TargetWindownow carries an optionalTitleRegex; matching requires both the primary regex and the title regex (if present) to match.MainViewModel.cs:WindowConfigViewModelexposesTitlePattern,TitlePatternType, andIsTitlePatternVisible(hidden whenMatchType == Titlesince that would be redundant).FindWindowauto-populatesTitlePatternfrom 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 whenIsTitlePatternVisibleis true.Resources: Added
TitlePatternstring (JP + EN).Example config shape
{ "MatchType": "Path", "PatternType": "Wildcard", "Pattern": "*\\MyApp.exe", "TitlePatternType": "Wildcard", "TitlePattern": "Editor - *" }This would only move/pin windows of
MyApp.exewhose title starts with"Editor - ", leaving other windows of the same process unaffected.Original prompt
🔒 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.