@@ -81,7 +81,8 @@ private List<Result> CreateResultsFromQuery(Query query)
8181 // Filter processes based on search term
8282 var searchTerm = query . Search ;
8383 var processlist = new List < ProcessResult > ( ) ;
84- var processWindowTitle = Settings . ShowWindowTitle ?
84+ var processWindowTitle =
85+ Settings . ShowWindowTitle || Settings . PutVisibleWindowProcessesTop ?
8586 ProcessHelper . GetProcessesWithNonEmptyWindowTitle ( ) :
8687 new Dictionary < int , string > ( ) ;
8788 if ( string . IsNullOrWhiteSpace ( searchTerm ) )
@@ -93,12 +94,22 @@ private List<Result> CreateResultsFromQuery(Query query)
9394 if ( processWindowTitle . TryGetValue ( p . Id , out var windowTitle ) )
9495 {
9596 // 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 ) ) ;
98104 }
99105 else
100106 {
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 ) ) ;
102113 }
103114 }
104115 }
@@ -117,13 +128,17 @@ private List<Result> CreateResultsFromQuery(Query query)
117128 if ( score > 0 )
118129 {
119130 // Add score to prioritize processes with visible windows
120- // And use window title for those processes
131+ // Use window title for those processes
121132 if ( Settings . PutVisibleWindowProcessesTop )
122133 {
123134 score += 200 ;
124135 }
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 ) ) ;
127142 }
128143 }
129144 else
@@ -132,7 +147,12 @@ private List<Result> CreateResultsFromQuery(Query query)
132147 var score = processNameIdMatch . Score ;
133148 if ( score > 0 )
134149 {
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 ) ) ;
136156 }
137157 }
138158 }
0 commit comments