@@ -81,7 +81,8 @@ private List<Result> CreateResultsFromQuery(Query query)
81
81
// Filter processes based on search term
82
82
var searchTerm = query . Search ;
83
83
var processlist = new List < ProcessResult > ( ) ;
84
- var processWindowTitle = Settings . ShowWindowTitle ?
84
+ var processWindowTitle =
85
+ Settings . ShowWindowTitle || Settings . PutVisibleWindowProcessesTop ?
85
86
ProcessHelper . GetProcessesWithNonEmptyWindowTitle ( ) :
86
87
new Dictionary < int , string > ( ) ;
87
88
if ( string . IsNullOrWhiteSpace ( searchTerm ) )
@@ -93,12 +94,22 @@ private List<Result> CreateResultsFromQuery(Query query)
93
94
if ( processWindowTitle . TryGetValue ( p . Id , out var windowTitle ) )
94
95
{
95
96
// Add score to prioritize processes with visible windows
96
- // And use window title for those processes
97
- processlist . Add ( new ProcessResult ( p , Settings . PutVisibleWindowProcessesTop ? 200 : 0 , windowTitle , null , progressNameIdTitle ) ) ;
97
+ // Use window title for those processes if enabled
98
+ processlist . Add ( new ProcessResult (
99
+ p ,
100
+ Settings . PutVisibleWindowProcessesTop ? 200 : 0 ,
101
+ Settings . ShowWindowTitle ? windowTitle : progressNameIdTitle ,
102
+ null ,
103
+ progressNameIdTitle ) ) ;
98
104
}
99
105
else
100
106
{
101
- processlist . Add ( new ProcessResult ( p , 0 , progressNameIdTitle , null , progressNameIdTitle ) ) ;
107
+ processlist . Add ( new ProcessResult (
108
+ p ,
109
+ 0 ,
110
+ progressNameIdTitle ,
111
+ null ,
112
+ progressNameIdTitle ) ) ;
102
113
}
103
114
}
104
115
}
@@ -117,13 +128,17 @@ private List<Result> CreateResultsFromQuery(Query query)
117
128
if ( score > 0 )
118
129
{
119
130
// Add score to prioritize processes with visible windows
120
- // And use window title for those processes
131
+ // Use window title for those processes
121
132
if ( Settings . PutVisibleWindowProcessesTop )
122
133
{
123
134
score += 200 ;
124
135
}
125
- processlist . Add ( new ProcessResult ( p , score , windowTitle ,
126
- score == windowTitleMatch . Score ? windowTitleMatch : null , progressNameIdTitle ) ) ;
136
+ processlist . Add ( new ProcessResult (
137
+ p ,
138
+ score ,
139
+ Settings . ShowWindowTitle ? windowTitle : progressNameIdTitle ,
140
+ score == windowTitleMatch . Score ? windowTitleMatch : null ,
141
+ progressNameIdTitle ) ) ;
127
142
}
128
143
}
129
144
else
@@ -132,7 +147,12 @@ private List<Result> CreateResultsFromQuery(Query query)
132
147
var score = processNameIdMatch . Score ;
133
148
if ( score > 0 )
134
149
{
135
- processlist . Add ( new ProcessResult ( p , score , progressNameIdTitle , processNameIdMatch , progressNameIdTitle ) ) ;
150
+ processlist . Add ( new ProcessResult (
151
+ p ,
152
+ score ,
153
+ progressNameIdTitle ,
154
+ processNameIdMatch ,
155
+ progressNameIdTitle ) ) ;
136
156
}
137
157
}
138
158
}
0 commit comments