Merge pull request #3846 from Flow-Launcher/nuget_dependency

Upgrade NuGet Dependencies & Package Lock Json Files
This commit is contained in:
Jack Ye 2025-07-24 11:52:04 +01:00 committed by GitHub
commit 65cfb29cfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 928 additions and 564 deletions

View file

@ -55,12 +55,12 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Droplex" Version="1.7.0" /> <PackageReference Include="Droplex" Version="1.7.0" />
<PackageReference Include="FSharp.Core" Version="9.0.201" /> <PackageReference Include="FSharp.Core" Version="9.0.300" />
<PackageReference Include="Meziantou.Framework.Win32.Jobs" Version="3.4.0" /> <PackageReference Include="Meziantou.Framework.Win32.Jobs" Version="3.4.3" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" /> <PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageReference Include="SemanticVersioning" Version="3.0.0" /> <PackageReference Include="SemanticVersioning" Version="3.0.0" />
<PackageReference Include="squirrel.windows" Version="1.5.2" NoWarn="NU1701" /> <PackageReference Include="squirrel.windows" Version="1.5.2" NoWarn="NU1701" />
<PackageReference Include="StreamJsonRpc" Version="2.21.10" /> <PackageReference Include="StreamJsonRpc" Version="2.22.11" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -13,15 +13,15 @@
}, },
"FSharp.Core": { "FSharp.Core": {
"type": "Direct", "type": "Direct",
"requested": "[9.0.101, )", "requested": "[9.0.300, )",
"resolved": "9.0.101", "resolved": "9.0.300",
"contentHash": "3/YR1SDWFA+Ojx9HiBwND+0UR8ZWoeZfkhD0DWAPCDdr/YI+CyFkArmMGzGSyPXeYtjG0sy0emzfyNwjt7zhig==" "contentHash": "TVt2J7RCE1KCS2IaONF+p8/KIZ1eHNbW+7qmKF6hGoD4tXl+o07ja1mPtFjMqRa5uHMFaTrGTPn/m945WnDLiQ=="
}, },
"Meziantou.Framework.Win32.Jobs": { "Meziantou.Framework.Win32.Jobs": {
"type": "Direct", "type": "Direct",
"requested": "[3.4.0, )", "requested": "[3.4.3, )",
"resolved": "3.4.0", "resolved": "3.4.3",
"contentHash": "5GGLckfpwoC1jznInEYfK2INrHyD7K1RtwZJ98kNPKBU6jeu24i4zfgDGHHfb+eK3J+eFPAxo0aYcbUxNXIbNw==" "contentHash": "REjInKnQ0OrhjjtSMPQtLtdURctCroB4L8Sd2gjTOYDysklvsdnrStx1tHS7uLv+fSyFF3aazZmo5Ka0v1oz/w=="
}, },
"Microsoft.IO.RecyclableMemoryStream": { "Microsoft.IO.RecyclableMemoryStream": {
"type": "Direct", "type": "Direct",
@ -29,6 +29,12 @@
"resolved": "3.0.1", "resolved": "3.0.1",
"contentHash": "s/s20YTVY9r9TPfTrN5g8zPF1YhwxyqO6PxUkrYTGI2B+OGPe9AdajWZrLhFqXIvqIW23fnUE4+ztrUWNU1+9g==" "contentHash": "s/s20YTVY9r9TPfTrN5g8zPF1YhwxyqO6PxUkrYTGI2B+OGPe9AdajWZrLhFqXIvqIW23fnUE4+ztrUWNU1+9g=="
}, },
"SemanticVersioning": {
"type": "Direct",
"requested": "[3.0.0, )",
"resolved": "3.0.0",
"contentHash": "RR+8GbPQ/gjDqov/1QN1OPoUlbUruNwcL3WjWCeLw+MY7+od/ENhnkYxCfAC6rQLIu3QifaJt3kPYyP3RumqMQ=="
},
"squirrel.windows": { "squirrel.windows": {
"type": "Direct", "type": "Direct",
"requested": "[1.5.2, )", "requested": "[1.5.2, )",
@ -42,16 +48,15 @@
}, },
"StreamJsonRpc": { "StreamJsonRpc": {
"type": "Direct", "type": "Direct",
"requested": "[2.20.20, )", "requested": "[2.22.11, )",
"resolved": "2.20.20", "resolved": "2.22.11",
"contentHash": "gwG7KViLbSWS7EI0kYevinVmIga9wZNrpSY/FnWyC6DbdjKJ1xlv/FV1L9b0rLkVP8cGxfIMexdvo/+2W5eq6Q==", "contentHash": "TQcqBFswLNpdSJANjhxZmIIe0Yl0kGqzjZ+uHLdhrkxntofvNu6C53XPEEYQ3Wkj8AorKumkuv/VMvTH4BHOZw==",
"dependencies": { "dependencies": {
"MessagePack": "2.5.187", "MessagePack": "2.5.192",
"Microsoft.VisualStudio.Threading": "17.10.48", "Microsoft.VisualStudio.Threading.Only": "17.13.61",
"Microsoft.VisualStudio.Threading.Analyzers": "17.10.48",
"Microsoft.VisualStudio.Validation": "17.8.8", "Microsoft.VisualStudio.Validation": "17.8.8",
"Nerdbank.Streams": "2.11.74", "Nerdbank.Streams": "2.12.87",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "13.0.3",
"System.IO.Pipelines": "8.0.0" "System.IO.Pipelines": "8.0.0"
} }
}, },
@ -65,8 +70,8 @@
}, },
"BitFaster.Caching": { "BitFaster.Caching": {
"type": "Transitive", "type": "Transitive",
"resolved": "2.5.3", "resolved": "2.5.4",
"contentHash": "Vo/39qcam5Xe+DbyfH0JZyqPswdOoa7jv4PGtRJ6Wj8AU+aZ+TuJRlJcIe+MQjRTJwliI8k8VSQpN8sEoBIv2g==" "contentHash": "1QroTY1PVCZOSG9FnkkCrmCKk/+bZCgI/YXq376HnYwUDJ4Ho0EaV4YaA/5v5WYLnwIwIO7RZkdWbg9pxIpueQ=="
}, },
"CommunityToolkit.Mvvm": { "CommunityToolkit.Mvvm": {
"type": "Transitive", "type": "Transitive",
@ -78,6 +83,11 @@
"resolved": "1.0.0", "resolved": "1.0.0",
"contentHash": "nwbZAYd+DblXAIzlnwDSnl0CiCm8jWLfHSYnoN4wYhtIav6AegB3+T/vKzLbU2IZlPB8Bvl8U3NXpx3eaz+N5w==" "contentHash": "nwbZAYd+DblXAIzlnwDSnl0CiCm8jWLfHSYnoN4wYhtIav6AegB3+T/vKzLbU2IZlPB8Bvl8U3NXpx3eaz+N5w=="
}, },
"InputSimulator": {
"type": "Transitive",
"resolved": "1.0.4",
"contentHash": "D0LvRCPQMX6/FJHBjng+RO+wRDuHTJrfo7IAc7rmkPvRqchdVGJWg3y70peOtDy3OLNK+HSOwVkH4GiuLnkKgA=="
},
"JetBrains.Annotations": { "JetBrains.Annotations": {
"type": "Transitive", "type": "Transitive",
"resolved": "2024.3.0", "resolved": "2024.3.0",
@ -85,36 +95,36 @@
}, },
"MemoryPack": { "MemoryPack": {
"type": "Transitive", "type": "Transitive",
"resolved": "1.21.3", "resolved": "1.21.4",
"contentHash": "cwCtED8y400vMWx/Vp0QCSeEpVFjDU4JwF52VX9WTaqVERUvNqjG9n6osFlmFuytegyXnHvYEu1qRJ8rv/rkbg==", "contentHash": "wy3JTBNBsO8LfQcBvvYsWr3lm2Oakolrfu0UQ3oSJSEiD+7ye0GUhYTaXuYYBowqsXBXWD9gf2218ae0JRiYVQ==",
"dependencies": { "dependencies": {
"MemoryPack.Core": "1.21.3", "MemoryPack.Core": "1.21.4",
"MemoryPack.Generator": "1.21.3" "MemoryPack.Generator": "1.21.4"
} }
}, },
"MemoryPack.Core": { "MemoryPack.Core": {
"type": "Transitive", "type": "Transitive",
"resolved": "1.21.3", "resolved": "1.21.4",
"contentHash": "ajrYoBWT2aKeH4tlY8q/1C9qK1R/NK+7FkuVOX58ebOSxkABoFTqCR7W+Zk2rakUHZiEgNdRqO67hiRZPq6fLA==" "contentHash": "6RszGorZ0ejNmp37ZcboPBMvvPCuNW2jlrdQfcs/lMzE5b3pmPF6hsm/laDc34hRlbAST1ZxaX/DvYu2DF5sBQ=="
}, },
"MemoryPack.Generator": { "MemoryPack.Generator": {
"type": "Transitive", "type": "Transitive",
"resolved": "1.21.3", "resolved": "1.21.4",
"contentHash": "hYU0TAIarDKnbkNIWvb7P4zBUL+CTahkuNkczsKvycSMR5kiwQ4IfLexywNKX3s05Izp4gzDSPbueepNWZRpWA==" "contentHash": "g14EsSS85yn0lHTi0J9ivqlZMf09A2iI51fmI+0KkzIzyCbWOBWPi5mdaY7YWmXprk12aYh9u/qfWHQUYthlwg=="
}, },
"MessagePack": { "MessagePack": {
"type": "Transitive", "type": "Transitive",
"resolved": "2.5.187", "resolved": "2.5.192",
"contentHash": "uW4j8m4Nc+2Mk5n6arOChavJ9bLjkis0qWASOj2h2OwmfINuzYv+mjCHUymrYhmyyKTu3N+ObtTXAY4uQ7jIhg==", "contentHash": "Jtle5MaFeIFkdXtxQeL9Tu2Y3HsAQGoSntOzrn6Br/jrl6c8QmG22GEioT5HBtZJR0zw0s46OnKU8ei2M3QifA==",
"dependencies": { "dependencies": {
"MessagePack.Annotations": "2.5.187", "MessagePack.Annotations": "2.5.192",
"Microsoft.NET.StringTools": "17.6.3" "Microsoft.NET.StringTools": "17.6.3"
} }
}, },
"MessagePack.Annotations": { "MessagePack.Annotations": {
"type": "Transitive", "type": "Transitive",
"resolved": "2.5.187", "resolved": "2.5.192",
"contentHash": "/IvvMMS8opvlHjEJ/fR2Cal4Co726Kj77Z8KiohFhuHfLHHmb9uUxW5+tSCL4ToKFfkQlrS3HD638mRq83ySqA==" "contentHash": "jaJuwcgovWIZ8Zysdyf3b7b34/BrADw4v82GaEZymUhDd3ScMPrYd/cttekeDteJJPXseJxp04yTIcxiVUjTWg=="
}, },
"Microsoft.NET.StringTools": { "Microsoft.NET.StringTools": {
"type": "Transitive", "type": "Transitive",
@ -123,17 +133,26 @@
}, },
"Microsoft.VisualStudio.Threading": { "Microsoft.VisualStudio.Threading": {
"type": "Transitive", "type": "Transitive",
"resolved": "17.12.19", "resolved": "17.14.15",
"contentHash": "eLiGMkMYyaSguqHs3lsrFxy3tAWSLuPEL2pIWRcADMDVAs2xqm3dr1d9QYjiEusTgiClF9KD6OB2NdZP72Oy0Q==", "contentHash": "1DrCusT3xNLSlaJg77BsUSAzrhjdZBAvvsS0PMzyPM+fGais6SnISOhqdZQop8VVMIBLsYm2gyF9W7THjgavwA==",
"dependencies": { "dependencies": {
"Microsoft.VisualStudio.Threading.Analyzers": "17.12.19", "Microsoft.VisualStudio.Threading.Analyzers": "17.14.15",
"Microsoft.VisualStudio.Threading.Only": "17.14.15",
"Microsoft.VisualStudio.Validation": "17.8.8" "Microsoft.VisualStudio.Validation": "17.8.8"
} }
}, },
"Microsoft.VisualStudio.Threading.Analyzers": { "Microsoft.VisualStudio.Threading.Analyzers": {
"type": "Transitive", "type": "Transitive",
"resolved": "17.12.19", "resolved": "17.14.15",
"contentHash": "v3IYeedjoktvZ+GqYmLudxZJngmf/YWIxNT2Uy6QMMN19cvw+nkWoip1Gr1RtnFkUo1MPUVMis4C8Kj8d8DpSQ==" "contentHash": "mXQPJsbuUD2ydq4/ffd8h8tSOFCXec+2xJOVNCvXjuMOq/+5EKHq3D2m2MC2+nUaXeFMSt66VS/J4HdKBixgcw=="
},
"Microsoft.VisualStudio.Threading.Only": {
"type": "Transitive",
"resolved": "17.14.15",
"contentHash": "NqONyw1RXyj9P3k5e1uU2k9kc1ptwuU5NJQzG+MPq7vQVHUzBY8HLuJf/N2Rw5H/myD96CVxziDxmjawPuzntw==",
"dependencies": {
"Microsoft.VisualStudio.Validation": "17.8.8"
}
}, },
"Microsoft.VisualStudio.Validation": { "Microsoft.VisualStudio.Validation": {
"type": "Transitive", "type": "Transitive",
@ -142,8 +161,8 @@
}, },
"Microsoft.Win32.SystemEvents": { "Microsoft.Win32.SystemEvents": {
"type": "Transitive", "type": "Transitive",
"resolved": "9.0.2", "resolved": "9.0.7",
"contentHash": "5BkGZ6mHp2dHydR29sb0fDfAuqkv30AHtTih8wMzvPZysOmBFvHfnkR2w3tsc0pSiIg8ZoKyefJXWy9r3pBh0w==" "contentHash": "lFGY2aGgmMREPJEfOmZcA6v0CLjWVpcfNHRgqYMoSQhy80+GxhYqdW5xe+DCLrVqE1M7/0RpOkIo49/KH/cd/A=="
}, },
"Mono.Cecil": { "Mono.Cecil": {
"type": "Transitive", "type": "Transitive",
@ -152,32 +171,50 @@
}, },
"Nerdbank.Streams": { "Nerdbank.Streams": {
"type": "Transitive", "type": "Transitive",
"resolved": "2.11.74", "resolved": "2.12.87",
"contentHash": "r4G7uHHfoo8LCilPOdtf2C+Q5ymHOAXtciT4ZtB2xRlAvv4gPkWBYNAijFblStv3+uidp81j5DP11jMZl4BfJw==", "contentHash": "oDKOeKZ865I5X8qmU3IXMyrAnssYEiYWTobPGdrqubN3RtTzEHIv+D6fwhdcfrdhPJzHjCkK/ORztR/IsnmA6g==",
"dependencies": { "dependencies": {
"Microsoft.VisualStudio.Threading": "17.10.48", "Microsoft.VisualStudio.Threading.Only": "17.13.61",
"Microsoft.VisualStudio.Validation": "17.8.8", "Microsoft.VisualStudio.Validation": "17.8.8",
"System.IO.Pipelines": "8.0.0" "System.IO.Pipelines": "8.0.0"
} }
}, },
"Newtonsoft.Json": { "Newtonsoft.Json": {
"type": "Transitive", "type": "Transitive",
"resolved": "13.0.1", "resolved": "13.0.3",
"contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A==" "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ=="
},
"NHotkey": {
"type": "Transitive",
"resolved": "3.0.0",
"contentHash": "IEghs0QqWsQYH0uUmvIl0Ye6RaebWRh38eB6ToOkDnQucTYRGFOgtig0gSxlwCszTilYFz3n1ZuY762x+kDR3A=="
},
"NHotkey.Wpf": {
"type": "Transitive",
"resolved": "3.0.0",
"contentHash": "BIUKlhTG5KtFf9OQzWvkmVmktt5/FFj6AOEgag8Uf0R2YdZt5ajUzs3sVskcJcT2TztWlEHKQr1jFj3KQ0D9Nw==",
"dependencies": {
"NHotkey": "3.0.0"
}
}, },
"NLog": { "NLog": {
"type": "Transitive", "type": "Transitive",
"resolved": "4.7.10", "resolved": "6.0.1",
"contentHash": "rcegW7kYOCjl7wX0SzsqpPBqnJ51JKi1WkYb6QBVX0Wc5IgH19Pv4t/co+T0s06OS0Ne44xgkY/mHg0PdrmJow==" "contentHash": "qDWiqy8/xdpZKtHna/645KbalwP86N2NFJEzfqhcv+Si4V2iNaEfR/dCneuF/4+Dcwl3f7jHMXj3ndWYftV3Ug=="
}, },
"PropertyChanged.Fody": { "NLog.OutputDebugString": {
"type": "Transitive", "type": "Transitive",
"resolved": "3.4.0", "resolved": "6.0.1",
"contentHash": "IAZyq0uolKo2WYm4mjx+q7A8fSGFT0x2e1s3y+ODn4JI0kqTDoo9GF2tdaypUzRFJZfdMxfC5HZW9QzdJLtOnA==", "contentHash": "wwJCQLaHVzuRf8TsXB+EEdrzVvE3dnzCSMQMDgwkw3AXp8VSp3JSVF/Q/H0oEqggKgKhPs13hh3a7svyQr4s3A==",
"dependencies": { "dependencies": {
"Fody": "6.5.1" "NLog": "6.0.1"
} }
}, },
"SharpVectors.Wpf": {
"type": "Transitive",
"resolved": "1.8.4.2",
"contentHash": "PNxLkMBJnV8A+6yH9OqOlhLJegvWP/dvh0rAJp2l0kcrR+rB4R2tQ9vhUqka+UilH4atN8T6zvjDOizVyfz2Ng=="
},
"Splat": { "Splat": {
"type": "Transitive", "type": "Transitive",
"resolved": "1.6.2", "resolved": "1.6.2",
@ -185,10 +222,10 @@
}, },
"System.Drawing.Common": { "System.Drawing.Common": {
"type": "Transitive", "type": "Transitive",
"resolved": "9.0.2", "resolved": "9.0.7",
"contentHash": "JU947wzf8JbBS16Y5EIZzAlyQU+k68D7LRx6y03s2wlhlvLqkt/8uPBrjv2hJnnaJKbdb0GhQ3JZsfYXhrRjyg==", "contentHash": "1k/Pk7hcM3vP2tfIRRS2ECCCN7ya+hvocsM1JMc4ZDCU6qw7yOuUmqmCDfgXZ4Q4FS6jass2EAai5ByKodDi0g==",
"dependencies": { "dependencies": {
"Microsoft.Win32.SystemEvents": "9.0.2" "Microsoft.Win32.SystemEvents": "9.0.7"
} }
}, },
"System.IO.Pipelines": { "System.IO.Pipelines": {
@ -203,8 +240,8 @@
}, },
"ToolGood.Words.Pinyin": { "ToolGood.Words.Pinyin": {
"type": "Transitive", "type": "Transitive",
"resolved": "3.0.1.4", "resolved": "3.1.0.3",
"contentHash": "uQo97618y9yzLDxrnehPN+/tuiOlk5BqieEdwctHZOAS9miMXnHKgMFYVw8CSGXRglyTYXlrW7qtUlU7Fje5Ew==" "contentHash": "VKcf8sUq/+LyY99WgLhOu7Q32ROEyR30/2xCCj9ADRi45wVC7kpXrYCf9vH1qirkmrIfpL8inoxAbrqAlfXxsQ=="
}, },
"YamlDotNet": { "YamlDotNet": {
"type": "Transitive", "type": "Transitive",
@ -215,22 +252,24 @@
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Ben.Demystifier": "[0.4.1, )", "Ben.Demystifier": "[0.4.1, )",
"BitFaster.Caching": "[2.5.3, )", "BitFaster.Caching": "[2.5.4, )",
"CommunityToolkit.Mvvm": "[8.4.0, )", "CommunityToolkit.Mvvm": "[8.4.0, )",
"Flow.Launcher.Plugin": "[4.4.0, )", "Flow.Launcher.Plugin": "[4.7.0, )",
"MemoryPack": "[1.21.3, )", "InputSimulator": "[1.0.4, )",
"Microsoft.VisualStudio.Threading": "[17.12.19, )", "MemoryPack": "[1.21.4, )",
"NLog": "[4.7.10, )", "Microsoft.VisualStudio.Threading": "[17.14.15, )",
"PropertyChanged.Fody": "[3.4.0, )", "NHotkey.Wpf": "[3.0.0, )",
"System.Drawing.Common": "[9.0.2, )", "NLog": "[6.0.1, )",
"ToolGood.Words.Pinyin": "[3.0.1.4, )" "NLog.OutputDebugString": "[6.0.1, )",
"SharpVectors.Wpf": "[1.8.4.2, )",
"System.Drawing.Common": "[9.0.7, )",
"ToolGood.Words.Pinyin": "[3.1.0.3, )"
} }
}, },
"flow.launcher.plugin": { "flow.launcher.plugin": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"JetBrains.Annotations": "[2024.3.0, )", "JetBrains.Annotations": "[2024.3.0, )"
"PropertyChanged.Fody": "[3.4.0, )"
} }
} }
} }

View file

@ -54,29 +54,28 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Ben.Demystifier" Version="0.4.1" /> <PackageReference Include="Ben.Demystifier" Version="0.4.1" />
<PackageReference Include="BitFaster.Caching" Version="2.5.3" /> <PackageReference Include="BitFaster.Caching" Version="2.5.4" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" /> <PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="Fody" Version="6.5.5"> <PackageReference Include="Fody" Version="6.9.2">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="InputSimulator" Version="1.0.4" /> <PackageReference Include="InputSimulator" Version="1.0.4" />
<PackageReference Include="MemoryPack" Version="1.21.4" /> <PackageReference Include="MemoryPack" Version="1.21.4" />
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="17.12.19" /> <PackageReference Include="Microsoft.VisualStudio.Threading" Version="17.14.15" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106"> <PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.183">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="NHotkey.Wpf" Version="3.0.0" /> <PackageReference Include="NHotkey.Wpf" Version="3.0.0" />
<PackageReference Include="NLog" Version="4.7.10" /> <PackageReference Include="NLog" Version="6.0.1" />
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0"> <PackageReference Include="NLog.OutputDebugString" Version="6.0.1" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="SharpVectors.Wpf" Version="1.8.4.2" /> <PackageReference Include="SharpVectors.Wpf" Version="1.8.4.2" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" /> <PackageReference Include="System.Drawing.Common" Version="9.0.7" />
<!--ToolGood.Words.Pinyin v3.0.2.6 results in high memory usage when search with pinyin is enabled--> <PackageReference Include="ToolGood.Words.Pinyin" Version="3.1.0.3" />
<!--Bumping to it or higher needs to test and ensure this is no longer a problem-->
<PackageReference Include="ToolGood.Words.Pinyin" Version="3.0.1.4" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -34,12 +34,6 @@ WINDOW_STYLE
SetLastError SetLastError
WINDOW_EX_STYLE WINDOW_EX_STYLE
GetSystemMetrics
EnumDisplayMonitors
MonitorFromWindow
GetMonitorInfo
MONITORINFOEXW
WM_ENTERSIZEMOVE WM_ENTERSIZEMOVE
WM_EXITSIZEMOVE WM_EXITSIZEMOVE
WM_NCLBUTTONDBLCLK WM_NCLBUTTONDBLCLK
@ -90,3 +84,6 @@ OpenProcess
QueryFullProcessImageName QueryFullProcessImageName
EVENT_OBJECT_HIDE EVENT_OBJECT_HIDE
EVENT_SYSTEM_DIALOGEND EVENT_SYSTEM_DIALOGEND
WM_POWERBROADCAST
PBT_APMRESUMEAUTOMATIC

View file

@ -13,6 +13,7 @@ using System.Windows.Interop;
using System.Windows.Markup; using System.Windows.Markup;
using System.Windows.Media; using System.Windows.Media;
using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin.SharedModels;
using Microsoft.Win32; using Microsoft.Win32;
using Microsoft.Win32.SafeHandles; using Microsoft.Win32.SafeHandles;
using Windows.Win32; using Windows.Win32;
@ -120,9 +121,9 @@ namespace Flow.Launcher.Infrastructure
#region Window Foreground #region Window Foreground
public static nint GetForegroundWindow() public static unsafe nint GetForegroundWindow()
{ {
return PInvoke.GetForegroundWindow().Value; return (nint)PInvoke.GetForegroundWindow().Value;
} }
public static bool SetForegroundWindow(Window window) public static bool SetForegroundWindow(Window window)
@ -286,15 +287,15 @@ namespace Flow.Launcher.Infrastructure
{ {
var hWndDesktop = PInvoke.FindWindowEx(hWnd, HWND.Null, "SHELLDLL_DefView", null); var hWndDesktop = PInvoke.FindWindowEx(hWnd, HWND.Null, "SHELLDLL_DefView", null);
hWndDesktop = PInvoke.FindWindowEx(hWndDesktop, HWND.Null, "SysListView32", "FolderView"); hWndDesktop = PInvoke.FindWindowEx(hWndDesktop, HWND.Null, "SysListView32", "FolderView");
if (hWndDesktop.Value != IntPtr.Zero) if (hWndDesktop != HWND.Null)
{ {
return false; return false;
} }
} }
var monitorInfo = MonitorInfo.GetNearestDisplayMonitor(hWnd); var monitorInfo = MonitorInfo.GetNearestDisplayMonitor(hWnd);
return (appBounds.bottom - appBounds.top) == monitorInfo.RectMonitor.Height && return (appBounds.bottom - appBounds.top) == monitorInfo.Bounds.Height &&
(appBounds.right - appBounds.left) == monitorInfo.RectMonitor.Width; (appBounds.right - appBounds.left) == monitorInfo.Bounds.Width;
} }
#endregion #endregion
@ -337,6 +338,9 @@ namespace Flow.Launcher.Infrastructure
public const int SC_MAXIMIZE = (int)PInvoke.SC_MAXIMIZE; public const int SC_MAXIMIZE = (int)PInvoke.SC_MAXIMIZE;
public const int SC_MINIMIZE = (int)PInvoke.SC_MINIMIZE; public const int SC_MINIMIZE = (int)PInvoke.SC_MINIMIZE;
public const int WM_POWERBROADCAST = (int)PInvoke.WM_POWERBROADCAST;
public const int PBT_APMRESUMEAUTOMATIC = (int)PInvoke.PBT_APMRESUMEAUTOMATIC;
#endregion #endregion
#region Window Handle #region Window Handle
@ -497,7 +501,7 @@ namespace Flow.Launcher.Infrastructure
/// Restores the previously backed-up keyboard layout. /// Restores the previously backed-up keyboard layout.
/// If it wasn't backed up or has already been restored, this method does nothing. /// If it wasn't backed up or has already been restored, this method does nothing.
/// </summary> /// </summary>
public static void RestorePreviousKeyboardLayout() public unsafe static void RestorePreviousKeyboardLayout()
{ {
if (_previousLayout == HKL.Null) return; if (_previousLayout == HKL.Null) return;
@ -508,7 +512,7 @@ namespace Flow.Launcher.Infrastructure
hwnd, hwnd,
PInvoke.WM_INPUTLANGCHANGEREQUEST, PInvoke.WM_INPUTLANGCHANGEREQUEST,
PInvoke.INPUTLANGCHANGE_FORWARD, PInvoke.INPUTLANGCHANGE_FORWARD,
_previousLayout.Value new LPARAM((nint)_previousLayout.Value)
); );
_previousLayout = HKL.Null; _previousLayout = HKL.Null;
@ -816,20 +820,17 @@ namespace Flow.Launcher.Infrastructure
if (threadId == 0) return string.Empty; if (threadId == 0) return string.Empty;
var process = PInvoke.OpenProcess(PROCESS_ACCESS_RIGHTS.PROCESS_QUERY_LIMITED_INFORMATION, false, pid); var process = PInvoke.OpenProcess(PROCESS_ACCESS_RIGHTS.PROCESS_QUERY_LIMITED_INFORMATION, false, pid);
if (process.Value != IntPtr.Zero) if (process != HWND.Null)
{ {
using var safeHandle = new SafeProcessHandle(process.Value, true); using var safeHandle = new SafeProcessHandle((nint)process.Value, true);
uint capacity = 2000; uint capacity = 2000;
Span<char> buffer = new char[capacity]; Span<char> buffer = new char[capacity];
fixed (char* pBuffer = buffer) if (!PInvoke.QueryFullProcessImageName(safeHandle, PROCESS_NAME_FORMAT.PROCESS_NAME_WIN32, buffer, ref capacity))
{ {
if (!PInvoke.QueryFullProcessImageName(safeHandle, PROCESS_NAME_FORMAT.PROCESS_NAME_WIN32, (PWSTR)pBuffer, ref capacity)) return string.Empty;
{
return string.Empty;
}
return buffer[..(int)capacity].ToString();
} }
return buffer[..(int)capacity].ToString();
} }
return string.Empty; return string.Empty;

View file

@ -13,9 +13,9 @@
}, },
"BitFaster.Caching": { "BitFaster.Caching": {
"type": "Direct", "type": "Direct",
"requested": "[2.5.3, )", "requested": "[2.5.4, )",
"resolved": "2.5.3", "resolved": "2.5.4",
"contentHash": "Vo/39qcam5Xe+DbyfH0JZyqPswdOoa7jv4PGtRJ6Wj8AU+aZ+TuJRlJcIe+MQjRTJwliI8k8VSQpN8sEoBIv2g==" "contentHash": "1QroTY1PVCZOSG9FnkkCrmCKk/+bZCgI/YXq376HnYwUDJ4Ho0EaV4YaA/5v5WYLnwIwIO7RZkdWbg9pxIpueQ=="
}, },
"CommunityToolkit.Mvvm": { "CommunityToolkit.Mvvm": {
"type": "Direct", "type": "Direct",
@ -25,70 +25,101 @@
}, },
"Fody": { "Fody": {
"type": "Direct", "type": "Direct",
"requested": "[6.5.5, )", "requested": "[6.9.2, )",
"resolved": "6.5.5", "resolved": "6.9.2",
"contentHash": "Krca41L/PDva1VsmDec5n52cQZxQAQp/bsHdzsNi8iLLI0lqKL94fNIkNaC8tVolUkCyWsbzvxfxJCeD2789fA==" "contentHash": "YBHobPGogb0vYhGYIxn/ndWqTjNWZveDi5jdjrcshL2vjwU3gQGyDeI7vGgye+2rAM5fGRvlLgNWLW3DpviS/w=="
},
"InputSimulator": {
"type": "Direct",
"requested": "[1.0.4, )",
"resolved": "1.0.4",
"contentHash": "D0LvRCPQMX6/FJHBjng+RO+wRDuHTJrfo7IAc7rmkPvRqchdVGJWg3y70peOtDy3OLNK+HSOwVkH4GiuLnkKgA=="
}, },
"MemoryPack": { "MemoryPack": {
"type": "Direct", "type": "Direct",
"requested": "[1.21.3, )", "requested": "[1.21.4, )",
"resolved": "1.21.3", "resolved": "1.21.4",
"contentHash": "cwCtED8y400vMWx/Vp0QCSeEpVFjDU4JwF52VX9WTaqVERUvNqjG9n6osFlmFuytegyXnHvYEu1qRJ8rv/rkbg==", "contentHash": "wy3JTBNBsO8LfQcBvvYsWr3lm2Oakolrfu0UQ3oSJSEiD+7ye0GUhYTaXuYYBowqsXBXWD9gf2218ae0JRiYVQ==",
"dependencies": { "dependencies": {
"MemoryPack.Core": "1.21.3", "MemoryPack.Core": "1.21.4",
"MemoryPack.Generator": "1.21.3" "MemoryPack.Generator": "1.21.4"
} }
}, },
"Microsoft.VisualStudio.Threading": { "Microsoft.VisualStudio.Threading": {
"type": "Direct", "type": "Direct",
"requested": "[17.12.19, )", "requested": "[17.14.15, )",
"resolved": "17.12.19", "resolved": "17.14.15",
"contentHash": "eLiGMkMYyaSguqHs3lsrFxy3tAWSLuPEL2pIWRcADMDVAs2xqm3dr1d9QYjiEusTgiClF9KD6OB2NdZP72Oy0Q==", "contentHash": "1DrCusT3xNLSlaJg77BsUSAzrhjdZBAvvsS0PMzyPM+fGais6SnISOhqdZQop8VVMIBLsYm2gyF9W7THjgavwA==",
"dependencies": { "dependencies": {
"Microsoft.VisualStudio.Threading.Analyzers": "17.12.19", "Microsoft.VisualStudio.Threading.Analyzers": "17.14.15",
"Microsoft.VisualStudio.Threading.Only": "17.14.15",
"Microsoft.VisualStudio.Validation": "17.8.8" "Microsoft.VisualStudio.Validation": "17.8.8"
} }
}, },
"Microsoft.Windows.CsWin32": { "Microsoft.Windows.CsWin32": {
"type": "Direct", "type": "Direct",
"requested": "[0.3.106, )", "requested": "[0.3.183, )",
"resolved": "0.3.106", "resolved": "0.3.183",
"contentHash": "Mx5fK7uN6fwLR4wUghs6//HonAnwPBNmC2oonyJVhCUlHS/r6SUS3NkBc3+gaQiv+0/9bqdj1oSCKQFkNI+21Q==", "contentHash": "Ze3aE2y7xgzKxEWtNb4SH0CExXpCHr3sbmwnvMiWMzJhWDX/G4Rs5wgg2UNs3VN+qVHh/DkDWLCPaVQv/b//Nw==",
"dependencies": { "dependencies": {
"Microsoft.Windows.SDK.Win32Docs": "0.1.42-alpha", "Microsoft.Windows.SDK.Win32Docs": "0.1.42-alpha",
"Microsoft.Windows.SDK.Win32Metadata": "60.0.34-preview", "Microsoft.Windows.SDK.Win32Metadata": "61.0.15-preview",
"Microsoft.Windows.WDK.Win32Metadata": "0.11.4-experimental" "Microsoft.Windows.WDK.Win32Metadata": "0.12.8-experimental"
}
},
"NHotkey.Wpf": {
"type": "Direct",
"requested": "[3.0.0, )",
"resolved": "3.0.0",
"contentHash": "BIUKlhTG5KtFf9OQzWvkmVmktt5/FFj6AOEgag8Uf0R2YdZt5ajUzs3sVskcJcT2TztWlEHKQr1jFj3KQ0D9Nw==",
"dependencies": {
"NHotkey": "3.0.0"
} }
}, },
"NLog": { "NLog": {
"type": "Direct", "type": "Direct",
"requested": "[4.7.10, )", "requested": "[6.0.1, )",
"resolved": "4.7.10", "resolved": "6.0.1",
"contentHash": "rcegW7kYOCjl7wX0SzsqpPBqnJ51JKi1WkYb6QBVX0Wc5IgH19Pv4t/co+T0s06OS0Ne44xgkY/mHg0PdrmJow==" "contentHash": "qDWiqy8/xdpZKtHna/645KbalwP86N2NFJEzfqhcv+Si4V2iNaEfR/dCneuF/4+Dcwl3f7jHMXj3ndWYftV3Ug=="
},
"NLog.OutputDebugString": {
"type": "Direct",
"requested": "[6.0.1, )",
"resolved": "6.0.1",
"contentHash": "wwJCQLaHVzuRf8TsXB+EEdrzVvE3dnzCSMQMDgwkw3AXp8VSp3JSVF/Q/H0oEqggKgKhPs13hh3a7svyQr4s3A==",
"dependencies": {
"NLog": "6.0.1"
}
}, },
"PropertyChanged.Fody": { "PropertyChanged.Fody": {
"type": "Direct", "type": "Direct",
"requested": "[3.4.0, )", "requested": "[4.1.0, )",
"resolved": "3.4.0", "resolved": "4.1.0",
"contentHash": "IAZyq0uolKo2WYm4mjx+q7A8fSGFT0x2e1s3y+ODn4JI0kqTDoo9GF2tdaypUzRFJZfdMxfC5HZW9QzdJLtOnA==", "contentHash": "6v+f9cI8YjnZH2WBHuOqWEAo8DFFNGFIdU8xD3AsL6fhV6Y8oAmVWd7XKk49t8DpeUBwhR/X+97+6Epvek0Y3A==",
"dependencies": { "dependencies": {
"Fody": "6.5.1" "Fody": "6.6.4"
} }
}, },
"SharpVectors.Wpf": {
"type": "Direct",
"requested": "[1.8.4.2, )",
"resolved": "1.8.4.2",
"contentHash": "PNxLkMBJnV8A+6yH9OqOlhLJegvWP/dvh0rAJp2l0kcrR+rB4R2tQ9vhUqka+UilH4atN8T6zvjDOizVyfz2Ng=="
},
"System.Drawing.Common": { "System.Drawing.Common": {
"type": "Direct", "type": "Direct",
"requested": "[9.0.2, )", "requested": "[9.0.7, )",
"resolved": "9.0.2", "resolved": "9.0.7",
"contentHash": "JU947wzf8JbBS16Y5EIZzAlyQU+k68D7LRx6y03s2wlhlvLqkt/8uPBrjv2hJnnaJKbdb0GhQ3JZsfYXhrRjyg==", "contentHash": "1k/Pk7hcM3vP2tfIRRS2ECCCN7ya+hvocsM1JMc4ZDCU6qw7yOuUmqmCDfgXZ4Q4FS6jass2EAai5ByKodDi0g==",
"dependencies": { "dependencies": {
"Microsoft.Win32.SystemEvents": "9.0.2" "Microsoft.Win32.SystemEvents": "9.0.7"
} }
}, },
"ToolGood.Words.Pinyin": { "ToolGood.Words.Pinyin": {
"type": "Direct", "type": "Direct",
"requested": "[3.0.1.4, )", "requested": "[3.1.0.3, )",
"resolved": "3.0.1.4", "resolved": "3.1.0.3",
"contentHash": "uQo97618y9yzLDxrnehPN+/tuiOlk5BqieEdwctHZOAS9miMXnHKgMFYVw8CSGXRglyTYXlrW7qtUlU7Fje5Ew==" "contentHash": "VKcf8sUq/+LyY99WgLhOu7Q32ROEyR30/2xCCj9ADRi45wVC7kpXrYCf9vH1qirkmrIfpL8inoxAbrqAlfXxsQ=="
}, },
"JetBrains.Annotations": { "JetBrains.Annotations": {
"type": "Transitive", "type": "Transitive",
@ -97,18 +128,26 @@
}, },
"MemoryPack.Core": { "MemoryPack.Core": {
"type": "Transitive", "type": "Transitive",
"resolved": "1.21.3", "resolved": "1.21.4",
"contentHash": "ajrYoBWT2aKeH4tlY8q/1C9qK1R/NK+7FkuVOX58ebOSxkABoFTqCR7W+Zk2rakUHZiEgNdRqO67hiRZPq6fLA==" "contentHash": "6RszGorZ0ejNmp37ZcboPBMvvPCuNW2jlrdQfcs/lMzE5b3pmPF6hsm/laDc34hRlbAST1ZxaX/DvYu2DF5sBQ=="
}, },
"MemoryPack.Generator": { "MemoryPack.Generator": {
"type": "Transitive", "type": "Transitive",
"resolved": "1.21.3", "resolved": "1.21.4",
"contentHash": "hYU0TAIarDKnbkNIWvb7P4zBUL+CTahkuNkczsKvycSMR5kiwQ4IfLexywNKX3s05Izp4gzDSPbueepNWZRpWA==" "contentHash": "g14EsSS85yn0lHTi0J9ivqlZMf09A2iI51fmI+0KkzIzyCbWOBWPi5mdaY7YWmXprk12aYh9u/qfWHQUYthlwg=="
}, },
"Microsoft.VisualStudio.Threading.Analyzers": { "Microsoft.VisualStudio.Threading.Analyzers": {
"type": "Transitive", "type": "Transitive",
"resolved": "17.12.19", "resolved": "17.14.15",
"contentHash": "v3IYeedjoktvZ+GqYmLudxZJngmf/YWIxNT2Uy6QMMN19cvw+nkWoip1Gr1RtnFkUo1MPUVMis4C8Kj8d8DpSQ==" "contentHash": "mXQPJsbuUD2ydq4/ffd8h8tSOFCXec+2xJOVNCvXjuMOq/+5EKHq3D2m2MC2+nUaXeFMSt66VS/J4HdKBixgcw=="
},
"Microsoft.VisualStudio.Threading.Only": {
"type": "Transitive",
"resolved": "17.14.15",
"contentHash": "NqONyw1RXyj9P3k5e1uU2k9kc1ptwuU5NJQzG+MPq7vQVHUzBY8HLuJf/N2Rw5H/myD96CVxziDxmjawPuzntw==",
"dependencies": {
"Microsoft.VisualStudio.Validation": "17.8.8"
}
}, },
"Microsoft.VisualStudio.Validation": { "Microsoft.VisualStudio.Validation": {
"type": "Transitive", "type": "Transitive",
@ -117,8 +156,8 @@
}, },
"Microsoft.Win32.SystemEvents": { "Microsoft.Win32.SystemEvents": {
"type": "Transitive", "type": "Transitive",
"resolved": "9.0.2", "resolved": "9.0.7",
"contentHash": "5BkGZ6mHp2dHydR29sb0fDfAuqkv30AHtTih8wMzvPZysOmBFvHfnkR2w3tsc0pSiIg8ZoKyefJXWy9r3pBh0w==" "contentHash": "lFGY2aGgmMREPJEfOmZcA6v0CLjWVpcfNHRgqYMoSQhy80+GxhYqdW5xe+DCLrVqE1M7/0RpOkIo49/KH/cd/A=="
}, },
"Microsoft.Windows.SDK.Win32Docs": { "Microsoft.Windows.SDK.Win32Docs": {
"type": "Transitive", "type": "Transitive",
@ -127,17 +166,22 @@
}, },
"Microsoft.Windows.SDK.Win32Metadata": { "Microsoft.Windows.SDK.Win32Metadata": {
"type": "Transitive", "type": "Transitive",
"resolved": "60.0.34-preview", "resolved": "61.0.15-preview",
"contentHash": "TA3DUNi4CTeo+ItTXBnGZFt2159XOGSl0UOlG5vjDj4WHqZjhwYyyUnzOtrbCERiSaP2Hzg7otJNWwOSZgutyA==" "contentHash": "cysex3dazKtCPALCluC2XX3f5Aedy9H2pw5jb+TW5uas2rkem1Z7FRnbUrg2vKx0pk0Qz+4EJNr37HdYTEcvEQ=="
}, },
"Microsoft.Windows.WDK.Win32Metadata": { "Microsoft.Windows.WDK.Win32Metadata": {
"type": "Transitive", "type": "Transitive",
"resolved": "0.11.4-experimental", "resolved": "0.12.8-experimental",
"contentHash": "bf5MCmUyZf0gBlYQjx9UpRAZWBkRndyt9XicR+UNLvAUAFTZQbu6YaX/sNKZlR98Grn0gydfh/yT4I3vc0AIQA==", "contentHash": "3n8R44/Z96Ly+ty4eYVJfESqbzvpw96lRLs3zOzyDmr1x1Kw7FNn5CyE416q+bZQV3e1HRuMUvyegMeRE/WedA==",
"dependencies": { "dependencies": {
"Microsoft.Windows.SDK.Win32Metadata": "60.0.34-preview" "Microsoft.Windows.SDK.Win32Metadata": "61.0.15-preview"
} }
}, },
"NHotkey": {
"type": "Transitive",
"resolved": "3.0.0",
"contentHash": "IEghs0QqWsQYH0uUmvIl0Ye6RaebWRh38eB6ToOkDnQucTYRGFOgtig0gSxlwCszTilYFz3n1ZuY762x+kDR3A=="
},
"System.Reflection.Metadata": { "System.Reflection.Metadata": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.0.0", "resolved": "5.0.0",
@ -146,8 +190,7 @@
"flow.launcher.plugin": { "flow.launcher.plugin": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"JetBrains.Annotations": "[2024.3.0, )", "JetBrains.Annotations": "[2024.3.0, )"
"PropertyChanged.Fody": "[3.4.0, )"
} }
} }
} }

View file

@ -68,17 +68,17 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Fody" Version="6.5.5"> <PackageReference Include="Fody" Version="6.9.2">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" /> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="JetBrains.Annotations" Version="2024.3.0" /> <PackageReference Include="JetBrains.Annotations" Version="2024.3.0" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106"> <PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.183">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0"> <PackageReference Include="PropertyChanged.Fody" Version="4.1.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>

View file

@ -5,4 +5,12 @@ GetWindowTextLength
WM_KEYDOWN WM_KEYDOWN
WM_KEYUP WM_KEYUP
WM_SYSKEYDOWN WM_SYSKEYDOWN
WM_SYSKEYUP WM_SYSKEYUP
GetSystemMetrics
EnumDisplayMonitors
MonitorFromWindow
GetMonitorInfo
MONITORINFOEXW
GetCursorPos
MonitorFromPoint

View file

@ -1,5 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows; using System.Windows;
using Windows.Win32; using Windows.Win32;
@ -7,13 +6,16 @@ using Windows.Win32.Foundation;
using Windows.Win32.Graphics.Gdi; using Windows.Win32.Graphics.Gdi;
using Windows.Win32.UI.WindowsAndMessaging; using Windows.Win32.UI.WindowsAndMessaging;
namespace Flow.Launcher.Infrastructure; namespace Flow.Launcher.Plugin.SharedModels;
/// <summary> /// <summary>
/// Contains full information about a display monitor. /// Contains full information about a display monitor.
/// Codes are edited from: <see href="https://github.com/Jack251970/DesktopWidgets3">. /// Inspired from: https://github.com/Jack251970/DesktopWidgets3.
/// </summary> /// </summary>
internal class MonitorInfo /// <remarks>
/// Use this class to replace the System.Windows.Forms.Screen class which can cause possible System.PlatformNotSupportedException.
/// </remarks>
public class MonitorInfo
{ {
/// <summary> /// <summary>
/// Gets the display monitors (including invisible pseudo-monitors associated with the mirroring drivers). /// Gets the display monitors (including invisible pseudo-monitors associated with the mirroring drivers).
@ -23,14 +25,14 @@ internal class MonitorInfo
{ {
var monitorCount = PInvoke.GetSystemMetrics(SYSTEM_METRICS_INDEX.SM_CMONITORS); var monitorCount = PInvoke.GetSystemMetrics(SYSTEM_METRICS_INDEX.SM_CMONITORS);
var list = new List<MonitorInfo>(monitorCount); var list = new List<MonitorInfo>(monitorCount);
var callback = new MONITORENUMPROC((HMONITOR monitor, HDC deviceContext, RECT* rect, LPARAM data) => var callback = new MONITORENUMPROC((monitor, deviceContext, rect, data) =>
{ {
list.Add(new MonitorInfo(monitor, rect)); list.Add(new MonitorInfo(monitor, rect));
return true; return true;
}); });
var dwData = new LPARAM(); var dwData = new LPARAM();
var hdc = new HDC(); var hdc = new HDC();
bool ok = PInvoke.EnumDisplayMonitors(hdc, (RECT?)null, callback, dwData); bool ok = PInvoke.EnumDisplayMonitors(hdc, null, callback, dwData);
if (!ok) if (!ok)
{ {
Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error()); Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error());
@ -43,11 +45,11 @@ internal class MonitorInfo
/// </summary> /// </summary>
/// <param name="hwnd">Window handle</param> /// <param name="hwnd">Window handle</param>
/// <returns>The display monitor that is nearest to a given window, or null if no monitor is found.</returns> /// <returns>The display monitor that is nearest to a given window, or null if no monitor is found.</returns>
public static unsafe MonitorInfo GetNearestDisplayMonitor(HWND hwnd) public static unsafe MonitorInfo GetNearestDisplayMonitor(nint hwnd)
{ {
var nearestMonitor = PInvoke.MonitorFromWindow(hwnd, MONITOR_FROM_FLAGS.MONITOR_DEFAULTTONEAREST); var nearestMonitor = PInvoke.MonitorFromWindow(new(hwnd), MONITOR_FROM_FLAGS.MONITOR_DEFAULTTONEAREST);
MonitorInfo nearestMonitorInfo = null; MonitorInfo nearestMonitorInfo = null;
var callback = new MONITORENUMPROC((HMONITOR monitor, HDC deviceContext, RECT* rect, LPARAM data) => var callback = new MONITORENUMPROC((monitor, deviceContext, rect, data) =>
{ {
if (monitor == nearestMonitor) if (monitor == nearestMonitor)
{ {
@ -58,7 +60,7 @@ internal class MonitorInfo
}); });
var dwData = new LPARAM(); var dwData = new LPARAM();
var hdc = new HDC(); var hdc = new HDC();
bool ok = PInvoke.EnumDisplayMonitors(hdc, (RECT?)null, callback, dwData); bool ok = PInvoke.EnumDisplayMonitors(hdc, null, callback, dwData);
if (!ok) if (!ok)
{ {
Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error()); Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error());
@ -66,17 +68,75 @@ internal class MonitorInfo
return nearestMonitorInfo; return nearestMonitorInfo;
} }
/// <summary>
/// Gets the primary display monitor (the one that contains the taskbar).
/// </summary>
/// <returns>The primary display monitor, or null if no monitor is found.</returns>
public static unsafe MonitorInfo GetPrimaryDisplayMonitor()
{
var primaryMonitor = PInvoke.MonitorFromWindow(new HWND(nint.Zero), MONITOR_FROM_FLAGS.MONITOR_DEFAULTTOPRIMARY);
MonitorInfo primaryMonitorInfo = null;
var callback = new MONITORENUMPROC((monitor, deviceContext, rect, data) =>
{
if (monitor == primaryMonitor)
{
primaryMonitorInfo = new MonitorInfo(monitor, rect);
return false;
}
return true;
});
var dwData = new LPARAM();
var hdc = new HDC();
bool ok = PInvoke.EnumDisplayMonitors(hdc, null, callback, dwData);
if (!ok)
{
Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error());
}
return primaryMonitorInfo;
}
/// <summary>
/// Gets the display monitor that contains the cursor.
/// </summary>
/// <returns>The display monitor that contains the cursor, or null if no monitor is found.</returns>
public static unsafe MonitorInfo GetCursorDisplayMonitor()
{
if (!PInvoke.GetCursorPos(out var pt))
{
Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error());
}
var cursorMonitor = PInvoke.MonitorFromPoint(pt, MONITOR_FROM_FLAGS.MONITOR_DEFAULTTONEAREST);
MonitorInfo cursorMonitorInfo = null;
var callback = new MONITORENUMPROC((monitor, deviceContext, rect, data) =>
{
if (monitor == cursorMonitor)
{
cursorMonitorInfo = new MonitorInfo(monitor, rect);
return false;
}
return true;
});
var dwData = new LPARAM();
var hdc = new HDC();
bool ok = PInvoke.EnumDisplayMonitors(hdc, null, callback, dwData);
if (!ok)
{
Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error());
}
return cursorMonitorInfo;
}
private readonly HMONITOR _monitor; private readonly HMONITOR _monitor;
internal unsafe MonitorInfo(HMONITOR monitor, RECT* rect) internal unsafe MonitorInfo(HMONITOR monitor, RECT* rect)
{ {
RectMonitor = Bounds =
new Rect(new Point(rect->left, rect->top), new Rect(new Point(rect->left, rect->top),
new Point(rect->right, rect->bottom)); new Point(rect->right, rect->bottom));
_monitor = monitor; _monitor = monitor;
var info = new MONITORINFOEXW() { monitorInfo = new MONITORINFO() { cbSize = (uint)sizeof(MONITORINFOEXW) } }; var info = new MONITORINFOEXW() { monitorInfo = new MONITORINFO() { cbSize = (uint)sizeof(MONITORINFOEXW) } };
GetMonitorInfo(monitor, ref info); GetMonitorInfo(monitor, ref info);
RectWork = WorkingArea =
new Rect(new Point(info.monitorInfo.rcWork.left, info.monitorInfo.rcWork.top), new Rect(new Point(info.monitorInfo.rcWork.left, info.monitorInfo.rcWork.top),
new Point(info.monitorInfo.rcWork.right, info.monitorInfo.rcWork.bottom)); new Point(info.monitorInfo.rcWork.right, info.monitorInfo.rcWork.bottom));
Name = new string(info.szDevice.AsSpan()).Replace("\0", "").Trim(); Name = new string(info.szDevice.AsSpan()).Replace("\0", "").Trim();
@ -93,7 +153,7 @@ internal class MonitorInfo
/// <remarks> /// <remarks>
/// <note>If the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative values.</note> /// <note>If the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative values.</note>
/// </remarks> /// </remarks>
public Rect RectMonitor { get; } public Rect Bounds { get; }
/// <summary> /// <summary>
/// Gets the work area rectangle of the display monitor, expressed in virtual-screen coordinates. /// Gets the work area rectangle of the display monitor, expressed in virtual-screen coordinates.
@ -101,15 +161,15 @@ internal class MonitorInfo
/// <remarks> /// <remarks>
/// <note>If the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative values.</note> /// <note>If the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative values.</note>
/// </remarks> /// </remarks>
public Rect RectWork { get; } public Rect WorkingArea { get; }
/// <summary> /// <summary>
/// Gets if the monitor is the the primary display monitor. /// Gets if the monitor is the primary display monitor.
/// </summary> /// </summary>
public bool IsPrimary => _monitor == PInvoke.MonitorFromWindow(new(IntPtr.Zero), MONITOR_FROM_FLAGS.MONITOR_DEFAULTTOPRIMARY); public bool IsPrimary => _monitor == PInvoke.MonitorFromWindow(new(nint.Zero), MONITOR_FROM_FLAGS.MONITOR_DEFAULTTOPRIMARY);
/// <inheritdoc /> /// <inheritdoc />
public override string ToString() => $"{Name} {RectMonitor.Width}x{RectMonitor.Height}"; public override string ToString() => $"{Name} {Bounds.Width}x{Bounds.Height}";
private static unsafe bool GetMonitorInfo(HMONITOR hMonitor, ref MONITORINFOEXW lpmi) private static unsafe bool GetMonitorInfo(HMONITOR hMonitor, ref MONITORINFOEXW lpmi)
{ {

View file

@ -4,9 +4,9 @@
"net9.0-windows7.0": { "net9.0-windows7.0": {
"Fody": { "Fody": {
"type": "Direct", "type": "Direct",
"requested": "[6.5.4, )", "requested": "[6.9.2, )",
"resolved": "6.5.4", "resolved": "6.9.2",
"contentHash": "GXZuti428IZctfby10xkMbWLCibcb6s29I/psLbBoO2vHJI5eTNVybnlV/Wi1tlIu9GG0bgW/PQwMH+MCldHxw==" "contentHash": "YBHobPGogb0vYhGYIxn/ndWqTjNWZveDi5jdjrcshL2vjwU3gQGyDeI7vGgye+2rAM5fGRvlLgNWLW3DpviS/w=="
}, },
"JetBrains.Annotations": { "JetBrains.Annotations": {
"type": "Direct", "type": "Direct",
@ -16,43 +16,43 @@
}, },
"Microsoft.SourceLink.GitHub": { "Microsoft.SourceLink.GitHub": {
"type": "Direct", "type": "Direct",
"requested": "[1.1.1, )", "requested": "[8.0.0, )",
"resolved": "1.1.1", "resolved": "8.0.0",
"contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==", "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==",
"dependencies": { "dependencies": {
"Microsoft.Build.Tasks.Git": "1.1.1", "Microsoft.Build.Tasks.Git": "8.0.0",
"Microsoft.SourceLink.Common": "1.1.1" "Microsoft.SourceLink.Common": "8.0.0"
} }
}, },
"Microsoft.Windows.CsWin32": { "Microsoft.Windows.CsWin32": {
"type": "Direct", "type": "Direct",
"requested": "[0.3.106, )", "requested": "[0.3.183, )",
"resolved": "0.3.106", "resolved": "0.3.183",
"contentHash": "Mx5fK7uN6fwLR4wUghs6//HonAnwPBNmC2oonyJVhCUlHS/r6SUS3NkBc3+gaQiv+0/9bqdj1oSCKQFkNI+21Q==", "contentHash": "Ze3aE2y7xgzKxEWtNb4SH0CExXpCHr3sbmwnvMiWMzJhWDX/G4Rs5wgg2UNs3VN+qVHh/DkDWLCPaVQv/b//Nw==",
"dependencies": { "dependencies": {
"Microsoft.Windows.SDK.Win32Docs": "0.1.42-alpha", "Microsoft.Windows.SDK.Win32Docs": "0.1.42-alpha",
"Microsoft.Windows.SDK.Win32Metadata": "60.0.34-preview", "Microsoft.Windows.SDK.Win32Metadata": "61.0.15-preview",
"Microsoft.Windows.WDK.Win32Metadata": "0.11.4-experimental" "Microsoft.Windows.WDK.Win32Metadata": "0.12.8-experimental"
} }
}, },
"PropertyChanged.Fody": { "PropertyChanged.Fody": {
"type": "Direct", "type": "Direct",
"requested": "[3.4.0, )", "requested": "[4.1.0, )",
"resolved": "3.4.0", "resolved": "4.1.0",
"contentHash": "IAZyq0uolKo2WYm4mjx+q7A8fSGFT0x2e1s3y+ODn4JI0kqTDoo9GF2tdaypUzRFJZfdMxfC5HZW9QzdJLtOnA==", "contentHash": "6v+f9cI8YjnZH2WBHuOqWEAo8DFFNGFIdU8xD3AsL6fhV6Y8oAmVWd7XKk49t8DpeUBwhR/X+97+6Epvek0Y3A==",
"dependencies": { "dependencies": {
"Fody": "6.5.1" "Fody": "6.6.4"
} }
}, },
"Microsoft.Build.Tasks.Git": { "Microsoft.Build.Tasks.Git": {
"type": "Transitive", "type": "Transitive",
"resolved": "1.1.1", "resolved": "8.0.0",
"contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q==" "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ=="
}, },
"Microsoft.SourceLink.Common": { "Microsoft.SourceLink.Common": {
"type": "Transitive", "type": "Transitive",
"resolved": "1.1.1", "resolved": "8.0.0",
"contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg==" "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw=="
}, },
"Microsoft.Windows.SDK.Win32Docs": { "Microsoft.Windows.SDK.Win32Docs": {
"type": "Transitive", "type": "Transitive",
@ -61,15 +61,15 @@
}, },
"Microsoft.Windows.SDK.Win32Metadata": { "Microsoft.Windows.SDK.Win32Metadata": {
"type": "Transitive", "type": "Transitive",
"resolved": "60.0.34-preview", "resolved": "61.0.15-preview",
"contentHash": "TA3DUNi4CTeo+ItTXBnGZFt2159XOGSl0UOlG5vjDj4WHqZjhwYyyUnzOtrbCERiSaP2Hzg7otJNWwOSZgutyA==" "contentHash": "cysex3dazKtCPALCluC2XX3f5Aedy9H2pw5jb+TW5uas2rkem1Z7FRnbUrg2vKx0pk0Qz+4EJNr37HdYTEcvEQ=="
}, },
"Microsoft.Windows.WDK.Win32Metadata": { "Microsoft.Windows.WDK.Win32Metadata": {
"type": "Transitive", "type": "Transitive",
"resolved": "0.11.4-experimental", "resolved": "0.12.8-experimental",
"contentHash": "bf5MCmUyZf0gBlYQjx9UpRAZWBkRndyt9XicR+UNLvAUAFTZQbu6YaX/sNKZlR98Grn0gydfh/yT4I3vc0AIQA==", "contentHash": "3n8R44/Z96Ly+ty4eYVJfESqbzvpw96lRLs3zOzyDmr1x1Kw7FNn5CyE416q+bZQV3e1HRuMUvyegMeRE/WedA==",
"dependencies": { "dependencies": {
"Microsoft.Windows.SDK.Win32Metadata": "60.0.34-preview" "Microsoft.Windows.SDK.Win32Metadata": "61.0.15-preview"
} }
} }
} }

View file

@ -48,13 +48,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Moq" Version="4.18.4" /> <PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="nunit" Version="4.3.2" /> <PackageReference Include="nunit" Version="4.3.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0"> <PackageReference Include="NUnit3TestAdapter" Version="5.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -86,7 +86,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="ChefKeys" Version="0.1.2" /> <PackageReference Include="ChefKeys" Version="0.1.2" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" /> <PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="Fody" Version="6.5.5"> <PackageReference Include="Fody" Version="6.9.2">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
@ -95,19 +95,18 @@
<PackageReference Include="MdXaml.Html" Version="1.27.0" /> <PackageReference Include="MdXaml.Html" Version="1.27.0" />
<PackageReference Include="MdXaml.Plugins" Version="1.27.0" /> <PackageReference Include="MdXaml.Plugins" Version="1.27.0" />
<PackageReference Include="MdXaml.Svg" Version="1.27.0" /> <PackageReference Include="MdXaml.Svg" Version="1.27.0" />
<!-- Do not upgrade Microsoft.Extensions.DependencyInjection and Microsoft.Extensions.Hosting since we are .Net7.0 --> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.7" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.7" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" /> <PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
<!-- ModernWpfUI v0.9.5 introduced WinRT changes that causes Notification platform unavailable error on some machines --> <!-- ModernWpfUI v0.9.5 introduced WinRT changes that causes Notification platform unavailable error on some machines -->
<!-- https://github.com/Flow-Launcher/Flow.Launcher/issues/1772#issuecomment-1502440801 --> <!-- https://github.com/Flow-Launcher/Flow.Launcher/issues/1772#issuecomment-1502440801 -->
<PackageReference Include="ModernWpfUI" Version="0.9.4" /> <PackageReference Include="ModernWpfUI" Version="0.9.4" />
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0"> <PackageReference Include="PropertyChanged.Fody" Version="4.1.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
<PackageReference Include="SemanticVersioning" Version="3.0.0" /> <PackageReference Include="SemanticVersioning" Version="3.0.0" />
<PackageReference Include="TaskScheduler" Version="2.12.1" /> <PackageReference Include="TaskScheduler" Version="2.12.2" />
<PackageReference Include="VirtualizingWrapPanel" Version="2.1.1" /> <PackageReference Include="VirtualizingWrapPanel" Version="2.3.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -121,7 +121,7 @@
<system:String x:Key="SearchPrecisionLow">Low</system:String> <system:String x:Key="SearchPrecisionLow">Low</system:String>
<system:String x:Key="SearchPrecisionRegular">Regular</system:String> <system:String x:Key="SearchPrecisionRegular">Regular</system:String>
<system:String x:Key="ShouldUsePinyin">Search with Pinyin</system:String> <system:String x:Key="ShouldUsePinyin">Search with Pinyin</system:String>
<system:String x:Key="ShouldUsePinyinToolTip">Allows using Pinyin to search. Pinyin is the standard system of romanized spelling for translating Chinese.</system:String> <system:String x:Key="ShouldUsePinyinToolTip">Pinyin is the standard system of romanized spelling for translating Chinese. Please note, enabling this can significantly increase memory usage during search.</system:String>
<system:String x:Key="ShouldUseDoublePinyin">Use Double Pinyin</system:String> <system:String x:Key="ShouldUseDoublePinyin">Use Double Pinyin</system:String>
<system:String x:Key="ShouldUseDoublePinyinToolTip">Use Double Pinyin instead of Full Pinyin to search.</system:String> <system:String x:Key="ShouldUseDoublePinyinToolTip">Use Double Pinyin instead of Full Pinyin to search.</system:String>
<system:String x:Key="DoublePinyinSchema">Double Pinyin Schema</system:String> <system:String x:Key="DoublePinyinSchema">Double Pinyin Schema</system:String>

View file

@ -1,4 +1,4 @@
using System; using System;
using System.ComponentModel; using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Media; using System.Media;
@ -23,14 +23,13 @@ using Flow.Launcher.Infrastructure.DialogJump;
using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin; using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.Plugin.SharedModels;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using Microsoft.Win32;
using ModernWpf.Controls; using ModernWpf.Controls;
using DataObject = System.Windows.DataObject; using DataObject = System.Windows.DataObject;
using Key = System.Windows.Input.Key; using Key = System.Windows.Input.Key;
using MouseButtons = System.Windows.Forms.MouseButtons; using MouseButtons = System.Windows.Forms.MouseButtons;
using NotifyIcon = System.Windows.Forms.NotifyIcon; using NotifyIcon = System.Windows.Forms.NotifyIcon;
using Screen = System.Windows.Forms.Screen;
namespace Flow.Launcher namespace Flow.Launcher
{ {
@ -96,7 +95,6 @@ namespace Flow.Launcher
InitSoundEffects(); InitSoundEffects();
DataObject.AddPastingHandler(QueryTextBox, QueryTextBox_OnPaste); DataObject.AddPastingHandler(QueryTextBox, QueryTextBox_OnPaste);
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
_viewModel.ActualApplicationThemeChanged += ViewModel_ActualApplicationThemeChanged; _viewModel.ActualApplicationThemeChanged += ViewModel_ActualApplicationThemeChanged;
} }
@ -532,7 +530,7 @@ namespace Flow.Launcher
double yRatio = mousePos.Y / maxHeight; double yRatio = mousePos.Y / maxHeight;
// Current monitor information // Current monitor information
var screen = Screen.FromHandle(new WindowInteropHelper(this).Handle); var screen = MonitorInfo.GetNearestDisplayMonitor(new WindowInteropHelper(this).Handle);
var workingArea = screen.WorkingArea; var workingArea = screen.WorkingArea;
var screenLeftTop = Win32Helper.TransformPixelsToDIP(this, workingArea.X, workingArea.Y); var screenLeftTop = Win32Helper.TransformPixelsToDIP(this, workingArea.X, workingArea.Y);
@ -670,6 +668,16 @@ namespace Flow.Launcher
handled = true; handled = true;
} }
break; break;
case Win32Helper.WM_POWERBROADCAST: // Handle power broadcast messages
// https://learn.microsoft.com/en-us/windows/win32/power/wm-powerbroadcast
if (wParam.ToInt32() == Win32Helper.PBT_APMRESUMEAUTOMATIC)
{
// Fix for sound not playing after sleep / hibernate
// https://stackoverflow.com/questions/64805186/mediaplayer-doesnt-play-after-computer-sleeps
InitSoundEffects();
}
handled = true;
break;
} }
return IntPtr.Zero; return IntPtr.Zero;
@ -679,16 +687,6 @@ namespace Flow.Launcher
#region Window Sound Effects #region Window Sound Effects
private void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
{
// Fix for sound not playing after sleep / hibernate
// https://stackoverflow.com/questions/64805186/mediaplayer-doesnt-play-after-computer-sleeps
if (e.Mode == PowerModes.Resume)
{
InitSoundEffects();
}
}
private void InitSoundEffects() private void InitSoundEffects()
{ {
if (_settings.WMPInstalled) if (_settings.WMPInstalled)
@ -954,36 +952,36 @@ namespace Flow.Launcher
} }
} }
private Screen SelectedScreen() private MonitorInfo SelectedScreen()
{ {
Screen screen; MonitorInfo screen;
switch (_settings.SearchWindowScreen) switch (_settings.SearchWindowScreen)
{ {
case SearchWindowScreens.Cursor: case SearchWindowScreens.Cursor:
screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position); screen = MonitorInfo.GetCursorDisplayMonitor();
break;
case SearchWindowScreens.Primary:
screen = Screen.PrimaryScreen;
break; break;
case SearchWindowScreens.Focus: case SearchWindowScreens.Focus:
var foregroundWindowHandle = Win32Helper.GetForegroundWindow(); screen = MonitorInfo.GetNearestDisplayMonitor(Win32Helper.GetForegroundWindow());
screen = Screen.FromHandle(foregroundWindowHandle); break;
case SearchWindowScreens.Primary:
screen = MonitorInfo.GetPrimaryDisplayMonitor();
break; break;
case SearchWindowScreens.Custom: case SearchWindowScreens.Custom:
if (_settings.CustomScreenNumber <= Screen.AllScreens.Length) var allScreens = MonitorInfo.GetDisplayMonitors();
screen = Screen.AllScreens[_settings.CustomScreenNumber - 1]; if (_settings.CustomScreenNumber <= allScreens.Count)
screen = allScreens[_settings.CustomScreenNumber - 1];
else else
screen = Screen.AllScreens[0]; screen = allScreens[0];
break; break;
default: default:
screen = Screen.AllScreens[0]; screen = MonitorInfo.GetDisplayMonitors()[0];
break; break;
} }
return screen ?? Screen.AllScreens[0]; return screen ?? MonitorInfo.GetDisplayMonitors()[0];
} }
private double HorizonCenter(Screen screen) private double HorizonCenter(MonitorInfo screen)
{ {
var dip1 = Win32Helper.TransformPixelsToDIP(this, screen.WorkingArea.X, 0); var dip1 = Win32Helper.TransformPixelsToDIP(this, screen.WorkingArea.X, 0);
var dip2 = Win32Helper.TransformPixelsToDIP(this, screen.WorkingArea.Width, 0); var dip2 = Win32Helper.TransformPixelsToDIP(this, screen.WorkingArea.Width, 0);
@ -991,7 +989,7 @@ namespace Flow.Launcher
return left; return left;
} }
private double VerticalCenter(Screen screen) private double VerticalCenter(MonitorInfo screen)
{ {
var dip1 = Win32Helper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Y); var dip1 = Win32Helper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Y);
var dip2 = Win32Helper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Height); var dip2 = Win32Helper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Height);
@ -999,7 +997,7 @@ namespace Flow.Launcher
return top; return top;
} }
private double HorizonRight(Screen screen) private double HorizonRight(MonitorInfo screen)
{ {
var dip1 = Win32Helper.TransformPixelsToDIP(this, screen.WorkingArea.X, 0); var dip1 = Win32Helper.TransformPixelsToDIP(this, screen.WorkingArea.X, 0);
var dip2 = Win32Helper.TransformPixelsToDIP(this, screen.WorkingArea.Width, 0); var dip2 = Win32Helper.TransformPixelsToDIP(this, screen.WorkingArea.Width, 0);
@ -1007,14 +1005,14 @@ namespace Flow.Launcher
return left; return left;
} }
private double HorizonLeft(Screen screen) private double HorizonLeft(MonitorInfo screen)
{ {
var dip1 = Win32Helper.TransformPixelsToDIP(this, screen.WorkingArea.X, 0); var dip1 = Win32Helper.TransformPixelsToDIP(this, screen.WorkingArea.X, 0);
var left = dip1.X + 10; var left = dip1.X + 10;
return left; return left;
} }
public double VerticalTop(Screen screen) private double VerticalTop(MonitorInfo screen)
{ {
var dip1 = Win32Helper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Y); var dip1 = Win32Helper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Y);
var top = dip1.Y + 10; var top = dip1.Y + 10;
@ -1443,7 +1441,6 @@ namespace Flow.Launcher
animationSoundWMP?.Close(); animationSoundWMP?.Close();
animationSoundWPF?.Dispose(); animationSoundWPF?.Dispose();
_viewModel.ActualApplicationThemeChanged -= ViewModel_ActualApplicationThemeChanged; _viewModel.ActualApplicationThemeChanged -= ViewModel_ActualApplicationThemeChanged;
SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged;
} }
_disposed = true; _disposed = true;

View file

@ -1,10 +1,10 @@
using System; using System;
using System.IO; using System.IO;
using System.Windows; using System.Windows;
using System.Windows.Forms;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media.Animation; using System.Windows.Media.Animation;
using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure;
using Flow.Launcher.Plugin.SharedModels;
namespace Flow.Launcher namespace Flow.Launcher
{ {
@ -16,7 +16,7 @@ namespace Flow.Launcher
public Msg() public Msg()
{ {
InitializeComponent(); InitializeComponent();
var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position); var screen = MonitorInfo.GetCursorDisplayMonitor();
var dipWorkingArea = Win32Helper.TransformPixelsToDIP(this, var dipWorkingArea = Win32Helper.TransformPixelsToDIP(this,
screen.WorkingArea.Width, screen.WorkingArea.Width,
screen.WorkingArea.Height); screen.WorkingArea.Height);

View file

@ -1,10 +1,10 @@
using System; using System;
using System.IO; using System.IO;
using System.Windows; using System.Windows;
using System.Windows.Forms;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media.Animation; using System.Windows.Media.Animation;
using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure;
using Flow.Launcher.Plugin.SharedModels;
namespace Flow.Launcher namespace Flow.Launcher
{ {
@ -16,7 +16,7 @@ namespace Flow.Launcher
public MsgWithButton() public MsgWithButton()
{ {
InitializeComponent(); InitializeComponent();
var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position); var screen = MonitorInfo.GetCursorDisplayMonitor();
var dipWorkingArea = Win32Helper.TransformPixelsToDIP(this, var dipWorkingArea = Win32Helper.TransformPixelsToDIP(this,
screen.WorkingArea.Width, screen.WorkingArea.Width,
screen.WorkingArea.Height); screen.WorkingArea.Height);

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
@ -111,9 +111,9 @@ public partial class SettingsPaneGeneralViewModel : BaseModel
{ {
get get
{ {
var screens = Screen.AllScreens; var screens = MonitorInfo.GetDisplayMonitors();
var screenNumbers = new List<int>(); var screenNumbers = new List<int>();
for (int i = 1; i <= screens.Length; i++) for (int i = 1; i <= screens.Count; i++)
{ {
screenNumbers.Add(i); screenNumbers.Add(i);
} }

View file

@ -7,10 +7,10 @@ using System.Windows.Interop;
using CommunityToolkit.Mvvm.DependencyInjection; using CommunityToolkit.Mvvm.DependencyInjection;
using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin.SharedModels;
using Flow.Launcher.SettingPages.Views; using Flow.Launcher.SettingPages.Views;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using ModernWpf.Controls; using ModernWpf.Controls;
using Screen = System.Windows.Forms.Screen;
namespace Flow.Launcher; namespace Flow.Launcher;
@ -202,7 +202,7 @@ public partial class SettingWindow
private static bool IsPositionValid(double top, double left) private static bool IsPositionValid(double top, double left)
{ {
foreach (var screen in Screen.AllScreens) foreach (var screen in MonitorInfo.GetDisplayMonitors())
{ {
var workingArea = screen.WorkingArea; var workingArea = screen.WorkingArea;
@ -217,7 +217,7 @@ public partial class SettingWindow
private double WindowLeft() private double WindowLeft()
{ {
var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position); var screen = MonitorInfo.GetCursorDisplayMonitor();
var dip1 = Win32Helper.TransformPixelsToDIP(this, screen.WorkingArea.X, 0); var dip1 = Win32Helper.TransformPixelsToDIP(this, screen.WorkingArea.X, 0);
var dip2 = Win32Helper.TransformPixelsToDIP(this, screen.WorkingArea.Width, 0); var dip2 = Win32Helper.TransformPixelsToDIP(this, screen.WorkingArea.Width, 0);
var left = (dip2.X - ActualWidth) / 2 + dip1.X; var left = (dip2.X - ActualWidth) / 2 + dip1.X;
@ -226,7 +226,7 @@ public partial class SettingWindow
private double WindowTop() private double WindowTop()
{ {
var screen = Screen.FromPoint(System.Windows.Forms.Cursor.Position); var screen = MonitorInfo.GetCursorDisplayMonitor();
var dip1 = Win32Helper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Y); var dip1 = Win32Helper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Y);
var dip2 = Win32Helper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Height); var dip2 = Win32Helper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Height);
var top = (dip2.Y - ActualHeight) / 2 + dip1.Y - 20; var top = (dip2.Y - ActualHeight) / 2 + dip1.Y - 20;

File diff suppressed because it is too large Load diff

View file

@ -96,7 +96,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" /> <PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.3" /> <PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.7" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -47,9 +47,8 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" /> <PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="Droplex" Version="1.7.0" /> <PackageReference Include="Droplex" Version="1.7.0" />
<!-- Do not upgrade System.Data.OleDb since we are .Net7.0 --> <PackageReference Include="System.Data.OleDb" Version="9.0.7" />
<PackageReference Include="System.Data.OleDb" Version="9.0.3" /> <PackageReference Include="System.Linq.Async" Version="6.0.3" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="tlbimp-Microsoft.Search.Interop" Version="1.0.0" /> <PackageReference Include="tlbimp-Microsoft.Search.Interop" Version="1.0.0" />
</ItemGroup> </ItemGroup>

View file

@ -7,6 +7,7 @@ using System.Windows.Input;
using Flow.Launcher.Plugin.Explorer.Search.Everything; using Flow.Launcher.Plugin.Explorer.Search.Everything;
using Flow.Launcher.Plugin.Explorer.Views; using Flow.Launcher.Plugin.Explorer.Views;
using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.Plugin.SharedModels;
using Peter; using Peter;
using Path = System.IO.Path; using Path = System.IO.Path;
@ -72,10 +73,10 @@ namespace Flow.Launcher.Plugin.Explorer.Search
internal static void ShowNativeContextMenu(string path, ResultType type) internal static void ShowNativeContextMenu(string path, ResultType type)
{ {
var screenWithMouseCursor = System.Windows.Forms.Screen.FromPoint(System.Windows.Forms.Cursor.Position); var screenWithMouseCursor = MonitorInfo.GetCursorDisplayMonitor();
var xOfScreenCenter = screenWithMouseCursor.WorkingArea.Left + screenWithMouseCursor.WorkingArea.Width / 2; var xOfScreenCenter = screenWithMouseCursor.WorkingArea.Left + screenWithMouseCursor.WorkingArea.Width / 2;
var yOfScreenCenter = screenWithMouseCursor.WorkingArea.Top + screenWithMouseCursor.WorkingArea.Height / 2; var yOfScreenCenter = screenWithMouseCursor.WorkingArea.Top + screenWithMouseCursor.WorkingArea.Height / 2;
var showPosition = new System.Drawing.Point(xOfScreenCenter, yOfScreenCenter); var showPosition = new System.Drawing.Point((int)xOfScreenCenter, (int)yOfScreenCenter);
switch (type) switch (type)
{ {

View file

@ -52,7 +52,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106"> <PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.183">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

View file

@ -163,23 +163,20 @@ namespace Flow.Launcher.Plugin.ProcessKiller
try try
{ {
var handle = PInvoke.OpenProcess(PROCESS_ACCESS_RIGHTS.PROCESS_QUERY_LIMITED_INFORMATION, false, (uint)p.Id); var handle = PInvoke.OpenProcess(PROCESS_ACCESS_RIGHTS.PROCESS_QUERY_LIMITED_INFORMATION, false, (uint)p.Id);
if (handle.Value == IntPtr.Zero) if (handle == HWND.Null)
{ {
return string.Empty; return string.Empty;
} }
using var safeHandle = new SafeProcessHandle(handle.Value, true); using var safeHandle = new SafeProcessHandle((nint)handle.Value, true);
uint capacity = 2000; uint capacity = 2000;
Span<char> buffer = new char[capacity]; Span<char> buffer = new char[capacity];
fixed (char* pBuffer = buffer) if (!PInvoke.QueryFullProcessImageName(safeHandle, PROCESS_NAME_FORMAT.PROCESS_NAME_WIN32, buffer, ref capacity))
{ {
if (!PInvoke.QueryFullProcessImageName(safeHandle, PROCESS_NAME_FORMAT.PROCESS_NAME_WIN32, (PWSTR)pBuffer, ref capacity)) return string.Empty;
{
return string.Empty;
}
return buffer[..(int)capacity].ToString();
} }
return buffer[..(int)capacity].ToString();
} }
catch catch
{ {

View file

@ -64,8 +64,8 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="ini-parser" Version="2.5.2" /> <PackageReference Include="ini-parser" Version="2.5.2" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="9.0.7" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106"> <PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.183">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

View file

@ -27,28 +27,36 @@ namespace Flow.Launcher.Plugin.Program.Programs
// If there is no resource to localize a file name the method returns a non zero value. // If there is no resource to localize a file name the method returns a non zero value.
fixed (char* bufferPtr = buffer) fixed (char* bufferPtr = buffer)
{ {
var result = PInvoke.SHGetLocalizedName(path, bufferPtr, capacity, out var id); int id;
if (result != HRESULT.S_OK) fixed (char* pathPtr = path)
{ {
return string.Empty; var result = PInvoke.SHGetLocalizedName(new PCWSTR(pathPtr), bufferPtr, capacity, &id);
}
var resourcePathStr = MemoryMarshal.CreateReadOnlySpanFromNullTerminated(bufferPtr).ToString(); if (result != HRESULT.S_OK)
_ = PInvoke.ExpandEnvironmentStrings(resourcePathStr, bufferPtr, capacity); {
using var handle = PInvoke.LoadLibraryEx(resourcePathStr, return string.Empty;
LOAD_LIBRARY_FLAGS.DONT_RESOLVE_DLL_REFERENCES | LOAD_LIBRARY_FLAGS.LOAD_LIBRARY_AS_DATAFILE); }
if (handle.IsInvalid)
{
return string.Empty;
}
// not sure about the behavior of Pinvoke.LoadString, so we clear the buffer before using it (so it must be a null-terminated string) var resourcePathStr = MemoryMarshal.CreateReadOnlySpanFromNullTerminated(bufferPtr).ToString();
buffer.Clear(); fixed (char* resourcePathPtr = resourcePathStr)
{
_ = PInvoke.ExpandEnvironmentStrings(new PCWSTR(resourcePathPtr), bufferPtr, capacity);
using var handle = PInvoke.LoadLibraryEx(resourcePathStr,
LOAD_LIBRARY_FLAGS.DONT_RESOLVE_DLL_REFERENCES | LOAD_LIBRARY_FLAGS.LOAD_LIBRARY_AS_DATAFILE);
if (handle.IsInvalid)
{
return string.Empty;
}
if (PInvoke.LoadString(handle, (uint)id, bufferPtr, capacity) != 0) // not sure about the behavior of Pinvoke.LoadString, so we clear the buffer before using it (so it must be a null-terminated string)
{ buffer.Clear();
var lString = MemoryMarshal.CreateReadOnlySpanFromNullTerminated(bufferPtr).ToString();
return lString; if (PInvoke.LoadString(handle, (uint)id, buffer, capacity) != 0)
{
var lString = MemoryMarshal.CreateReadOnlySpanFromNullTerminated(bufferPtr).ToString();
return lString;
}
}
} }
} }

View file

@ -58,7 +58,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106"> <PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.183">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>