Skip to content

Commit f6d3acb

Browse files
Properties window is now shown near mouse cursor position
1 parent a9370eb commit f6d3acb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Files.Uwp/Helpers/FilePropertiesHelpers.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ public static async Task OpenPropertiesWindowAsync(object item, IShellPage assoc
7777
appWindow.PersistedStateId = "Properties";
7878
WindowManagementPreview.SetPreferredMinSize(appWindow, new Size(460, 550));
7979

80+
DisplayRegion displayRegion = ApplicationView.GetForCurrentView().GetDisplayRegions()[0];
81+
Point pointerPosition = CoreWindow.GetForCurrentThread().PointerPosition;
82+
appWindow.RequestMoveRelativeToDisplayRegion(displayRegion,
83+
new Point(pointerPosition.X - displayRegion.WorkAreaOffset.X, pointerPosition.Y - displayRegion.WorkAreaOffset.Y));
84+
8085
bool windowShown = await appWindow.TryShowAsync();
8186
if (windowShown)
8287
{

0 commit comments

Comments
 (0)