@@ -1216,14 +1216,9 @@ private void RefreshItem(SelectorItem container, object item, bool inRecycleQueu
1216
1216
1217
1217
protected internal void FileListItem_PointerPressed ( object sender , PointerRoutedEventArgs e )
1218
1218
{
1219
- if ( ! itemDragging )
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
+ // Set can window to front and bring the window to the front if necessary
1220
+ if ( ( ! itemDragging ) && MainWindow . Instance . SetCanWindowToFront ( true ) )
1221
+ Win32Helper . BringToForegroundEx ( new ( MainWindow . Instance . WindowHandle ) ) ;
1227
1222
1228
1223
if ( sender is not SelectorItem selectorItem )
1229
1224
return ;
@@ -1250,6 +1245,7 @@ protected internal void FileListItem_PointerPressed(object sender, PointerRouted
1250
1245
1251
1246
protected internal void FileListItem_PointerEntered ( object sender , PointerRoutedEventArgs e )
1252
1247
{
1248
+ // Set can window to front before the item is dragged
1253
1249
if ( sender is SelectorItem selectorItem && selectorItem . IsSelected )
1254
1250
MainWindow . Instance . SetCanWindowToFront ( false ) ;
1255
1251
@@ -1299,9 +1295,9 @@ selectedItems is not null &&
1299
1295
1300
1296
protected internal void FileListItem_PointerExited ( object sender , PointerRoutedEventArgs e )
1301
1297
{
1298
+ // Set can window to front
1302
1299
if ( ! itemDragging )
1303
1300
MainWindow . Instance . SetCanWindowToFront ( true ) ;
1304
- // No need to bring the window to the front
1305
1301
1306
1302
if ( ! UserSettingsService . FoldersSettingsService . SelectFilesOnHover )
1307
1303
return ;
@@ -1312,38 +1308,23 @@ protected internal void FileListItem_PointerExited(object sender, PointerRoutedE
1312
1308
1313
1309
protected void FileListItem_Tapped ( object sender , TappedRoutedEventArgs e )
1314
1310
{
1315
- if ( ! itemDragging )
1316
- {
1317
- // No need to bring the window to the front again
1318
- if ( MainWindow . Instance . SetCanWindowToFront ( true ) )
1319
- {
1320
- Win32Helper . BringToForegroundEx ( new ( MainWindow . Instance . WindowHandle ) ) ;
1321
- }
1322
- }
1311
+ // Set can window to front and bring the window to the front if necessary
1312
+ if ( ( ! itemDragging ) && MainWindow . Instance . SetCanWindowToFront ( true ) )
1313
+ Win32Helper . BringToForegroundEx ( new ( MainWindow . Instance . WindowHandle ) ) ;
1323
1314
}
1324
1315
1325
1316
protected void FileListItem_DoubleTapped ( object sender , DoubleTappedRoutedEventArgs e )
1326
1317
{
1327
- if ( ! itemDragging )
1328
- {
1329
- // No need to bring the window to the front again
1330
- if ( MainWindow . Instance . SetCanWindowToFront ( true ) )
1331
- {
1332
- Win32Helper . BringToForegroundEx ( new ( MainWindow . Instance . WindowHandle ) ) ;
1333
- }
1334
- }
1318
+ // Set can window to front and bring the window to the front if necessary
1319
+ if ( ( ! itemDragging ) && MainWindow . Instance . SetCanWindowToFront ( true ) )
1320
+ Win32Helper . BringToForegroundEx ( new ( MainWindow . Instance . WindowHandle ) ) ;
1335
1321
}
1336
1322
1337
1323
protected void FileListItem_RightTapped ( object sender , RightTappedRoutedEventArgs e )
1338
1324
{
1339
- if ( ! itemDragging )
1340
- {
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
- }
1346
- }
1325
+ // Set can window to front and bring the window to the front if necessary
1326
+ if ( ( ! itemDragging ) && MainWindow . Instance . SetCanWindowToFront ( true ) )
1327
+ Win32Helper . BringToForegroundEx ( new ( MainWindow . Instance . WindowHandle ) ) ;
1347
1328
1348
1329
var rightClickedItem = GetItemFromElement ( sender ) ;
1349
1330
0 commit comments