Skip to content

Commit 6739f4f

Browse files
committed
Code Quality: Removed useless function
1 parent 04244fc commit 6739f4f

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/Files.App/MainWindow.xaml.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,6 @@ public bool SetCanWindowToFront(bool canWindowToFront)
351351
return false;
352352
}
353353

354-
public void BringToFrontEx()
355-
{
356-
Win32Helper.BringToForegroundEx(new(WindowHandle));
357-
}
358-
359354
public void HookWindowMessageReceivedEvent()
360355
{
361356
WinUIEx.WindowManager.Get(this).WindowMessageReceived += WindowManager_WindowMessageReceived;

src/Files.App/Views/Layouts/BaseLayoutPage.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ protected void FileListItem_Tapped(object sender, TappedRoutedEventArgs e)
13101310
// No need to bring the window to the front again
13111311
if (MainWindow.Instance.SetCanWindowToFront(true))
13121312
{
1313-
MainWindow.Instance.BringToFrontEx();
1313+
Win32Helper.BringToForegroundEx(new(MainWindow.Instance.WindowHandle));
13141314
}
13151315
}
13161316
}
@@ -1322,7 +1322,7 @@ protected void FileListItem_DoubleTapped(object sender, DoubleTappedRoutedEventA
13221322
// No need to bring the window to the front again
13231323
if (MainWindow.Instance.SetCanWindowToFront(true))
13241324
{
1325-
MainWindow.Instance.BringToFrontEx();
1325+
Win32Helper.BringToForegroundEx(new(MainWindow.Instance.WindowHandle));
13261326
}
13271327
}
13281328
}
@@ -1332,7 +1332,8 @@ protected void FileListItem_RightTapped(object sender, RightTappedRoutedEventArg
13321332
if (!itemDragging)
13331333
{
13341334
MainWindow.Instance.SetCanWindowToFront(true);
1335-
MainWindow.Instance.BringToFrontEx();
1335+
// Bring the window to the front agin
1336+
Win32Helper.BringToForegroundEx(new(MainWindow.Instance.WindowHandle));
13361337
}
13371338

13381339
var rightClickedItem = GetItemFromElement(sender);

0 commit comments

Comments
 (0)