Skip to content

Commit 9e87160

Browse files
authored
Feature: SwitchPreview for SeerProProvider (#12557)
1 parent 18f59bd commit 9e87160

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Files.App/ServicesImplementation/PreviewPopupProviders/SeerProProvider.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public class SeerProProvider : IPreviewPopupProvider
1818
{
1919
public static SeerProProvider Instance { get; } = new();
2020

21+
private string? CurrentPath;
22+
2123
public async Task TogglePreviewPopup(string path)
2224
{
2325
HWND Window = User32.FindWindow("SeerWindowClass", null);
@@ -26,11 +28,14 @@ public async Task TogglePreviewPopup(string path)
2628
data.cbData = (path.Length + 1) * 2;
2729
data.lpData = Marshal.StringToHGlobalUni(path);
2830
User32.SendMessage(Window, (uint)User32.WindowMessage.WM_COPYDATA, 0, ref data);
31+
32+
CurrentPath = User32.IsWindowVisible(Window) ? path : null;
2933
}
3034

3135
public async Task SwitchPreview(string path)
3236
{
33-
// TODO
37+
if (CurrentPath is not null && path != CurrentPath)
38+
await TogglePreviewPopup(path);
3439
}
3540

3641
public async Task<bool> DetectAvailability()

0 commit comments

Comments
 (0)