@@ -1027,6 +1027,7 @@ protected virtual void FileList_DragItemsCompleted(ListViewBase sender, DragItem
1027
1027
{
1028
1028
itemDragging = false ;
1029
1029
MainWindow . Instance . SetCanWindowToFront ( true ) ;
1030
+ // No need to bring the window to the front
1030
1031
}
1031
1032
1032
1033
private void Item_DragLeave ( object sender , DragEventArgs e )
@@ -1158,8 +1159,9 @@ protected void FileList_ContainerContentChanging(ListViewBase sender, ContainerC
1158
1159
RefreshContainer ( args . ItemContainer , args . InRecycleQueue ) ;
1159
1160
RefreshItem ( args . ItemContainer , args . Item , args . InRecycleQueue , args ) ;
1160
1161
1161
- MainWindow . Instance . SetCanWindowToFront ( true ) ;
1162
1162
itemDragging = false ;
1163
+ MainWindow . Instance . SetCanWindowToFront ( true ) ;
1164
+ // No need to bring the window to the front
1163
1165
}
1164
1166
1165
1167
private void RefreshContainer ( SelectorItem container , bool inRecycleQueue )
@@ -1215,7 +1217,13 @@ private void RefreshItem(SelectorItem container, object item, bool inRecycleQueu
1215
1217
protected internal void FileListItem_PointerPressed ( object sender , PointerRoutedEventArgs e )
1216
1218
{
1217
1219
if ( ! itemDragging )
1218
- MainWindow . Instance . SetCanWindowToFront ( true ) ;
1220
+ {
1221
+ // No need to bring the window to the front again
1222
+ if ( MainWindow . Instance . SetCanWindowToFront ( true ) )
1223
+ {
1224
+ Win32Helper . BringToForegroundEx ( new ( MainWindow . Instance . WindowHandle ) ) ;
1225
+ }
1226
+ }
1219
1227
1220
1228
if ( sender is not SelectorItem selectorItem )
1221
1229
return ;
@@ -1243,9 +1251,7 @@ protected internal void FileListItem_PointerPressed(object sender, PointerRouted
1243
1251
protected internal void FileListItem_PointerEntered ( object sender , PointerRoutedEventArgs e )
1244
1252
{
1245
1253
if ( sender is SelectorItem selectorItem && selectorItem . IsSelected )
1246
- {
1247
1254
MainWindow . Instance . SetCanWindowToFront ( false ) ;
1248
- }
1249
1255
1250
1256
if ( ! UserSettingsService . FoldersSettingsService . SelectFilesOnHover )
1251
1257
return ;
@@ -1295,6 +1301,7 @@ protected internal void FileListItem_PointerExited(object sender, PointerRoutedE
1295
1301
{
1296
1302
if ( ! itemDragging )
1297
1303
MainWindow . Instance . SetCanWindowToFront ( true ) ;
1304
+ // No need to bring the window to the front
1298
1305
1299
1306
if ( ! UserSettingsService . FoldersSettingsService . SelectFilesOnHover )
1300
1307
return ;
@@ -1331,9 +1338,11 @@ protected void FileListItem_RightTapped(object sender, RightTappedRoutedEventArg
1331
1338
{
1332
1339
if ( ! itemDragging )
1333
1340
{
1334
- MainWindow . Instance . SetCanWindowToFront ( true ) ;
1335
- // Bring the window to the front agin
1336
- Win32Helper . BringToForegroundEx ( new ( MainWindow . Instance . WindowHandle ) ) ;
1341
+ // No need to bring the window to the front again
1342
+ if ( MainWindow . Instance . SetCanWindowToFront ( true ) )
1343
+ {
1344
+ Win32Helper . BringToForegroundEx ( new ( MainWindow . Instance . WindowHandle ) ) ;
1345
+ }
1337
1346
}
1338
1347
1339
1348
var rightClickedItem = GetItemFromElement ( sender ) ;
0 commit comments