Skip to content

Commit 3906122

Browse files
gave92gave92
andauthored
Code Quality: Update CsWin32 to latest version (#15296)
Co-authored-by: gave92 <gave@LAPTOP>
1 parent 10bfa4b commit 3906122

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

src/Files.App/Files.App.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
<PackageReference Include="Vanara.Windows.Shell" Version="4.0.1" />
103103
<PackageReference Include="Microsoft.Management.Infrastructure" Version="3.0.0" />
104104
<PackageReference Include="Microsoft.Management.Infrastructure.Runtime.Win" Version="3.0.0" />
105-
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.1.647-beta" PrivateAssets="all" />
105+
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.49-beta" PrivateAssets="all" />
106106
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.7" />
107107
</ItemGroup>
108108

src/Files.App/UserControls/TabBar/TabBar.xaml.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using Windows.ApplicationModel.DataTransfer;
1010
using Windows.Storage;
1111
using Windows.Win32;
12-
using Windows.Win32.Foundation;
1312

1413
namespace Files.App.UserControls.TabBar
1514
{
@@ -60,7 +59,7 @@ public Rectangle DragArea
6059
=> DragAreaRectangle;
6160

6261
/// <summary> Starting position when dragging a tab.</summary>
63-
private POINT dragStartPoint;
62+
private System.Drawing.Point dragStartPoint;
6463

6564
/// <summary> Starting time when dragging a tab. </summary>
6665
private DateTimeOffset dragStartTime;
@@ -246,7 +245,7 @@ private async void TabView_TabDroppedOutside(TabView sender, TabViewTabDroppedOu
246245
PInvoke.GetCursorPos(out var droppedPoint);
247246
var droppedTime = DateTimeOffset.UtcNow;
248247
var dragTime = droppedTime - dragStartTime;
249-
var dragDistance = Math.Sqrt(Math.Pow(dragStartPoint.x - droppedPoint.x, 2) + Math.Pow(dragStartPoint.y - droppedPoint.y, 2));
248+
var dragDistance = Math.Sqrt(Math.Pow(dragStartPoint.X - droppedPoint.X, 2) + Math.Pow(dragStartPoint.Y - droppedPoint.Y, 2));
250249

251250
if (sender.TabItems.Count == 1 ||
252251
(dragTime.TotalSeconds < 1 &&

src/Files.App/Utils/Storage/Helpers/FilePropertiesHelpers.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ public static void OpenPropertiesWindow(object item, IShellPage associatedInstan
138138

139139
// WINUI3: Move window to cursor position
140140
PInvoke.GetCursorPos(out var pointerPosition);
141-
var displayArea = DisplayArea.GetFromPoint(new PointInt32(pointerPosition.x, pointerPosition.y), DisplayAreaFallback.Nearest);
141+
var displayArea = DisplayArea.GetFromPoint(new PointInt32(pointerPosition.X, pointerPosition.Y), DisplayAreaFallback.Nearest);
142142
var appWindowPos = new PointInt32
143143
{
144144
X = displayArea.WorkArea.X
145-
+ Math.Max(0, Math.Min(displayArea.WorkArea.Width - appWindow.Size.Width, pointerPosition.x - displayArea.WorkArea.X)),
145+
+ Math.Max(0, Math.Min(displayArea.WorkArea.Width - appWindow.Size.Width, pointerPosition.X - displayArea.WorkArea.X)),
146146
Y = displayArea.WorkArea.Y
147-
+ Math.Max(0, Math.Min(displayArea.WorkArea.Height - appWindow.Size.Height, pointerPosition.y - displayArea.WorkArea.Y)),
147+
+ Math.Max(0, Math.Min(displayArea.WorkArea.Height - appWindow.Size.Height, pointerPosition.Y - displayArea.WorkArea.Y)),
148148
};
149149

150150
if (App.AppModel.IncrementPropertiesWindowCount() == 1)

src/Files.App/Utils/Taskbar/SystemTrayIcon.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,11 @@ private void ShowContextMenu()
236236

237237
TRACK_POPUP_MENU_FLAGS tRACK_POPUP_MENU_FLAGS =
238238
TRACK_POPUP_MENU_FLAGS.TPM_RETURNCMD |
239-
(PInvoke.GetSystemMetricsForDpi((int)SYSTEM_METRICS_INDEX.SM_MENUDROPALIGNMENT, PInvoke.GetDpiForWindow(_IconWindow.WindowHandle)) != 0
239+
(PInvoke.GetSystemMetricsForDpi(SYSTEM_METRICS_INDEX.SM_MENUDROPALIGNMENT, PInvoke.GetDpiForWindow(_IconWindow.WindowHandle)) != 0
240240
? TRACK_POPUP_MENU_FLAGS.TPM_RIGHTALIGN
241241
: TRACK_POPUP_MENU_FLAGS.TPM_LEFTBUTTON);
242242

243-
switch (PInvoke.TrackPopupMenuEx(hMenu, (uint)tRACK_POPUP_MENU_FLAGS, lpPoint.x, lpPoint.y, _IconWindow.WindowHandle, null).Value)
243+
switch (PInvoke.TrackPopupMenuEx(hMenu, (uint)tRACK_POPUP_MENU_FLAGS, lpPoint.X, lpPoint.Y, _IconWindow.WindowHandle, null).Value)
244244
{
245245
case 1:
246246
OnDocumentationClicked();

0 commit comments

Comments
 (0)