mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-12-12 02:00:27 +08:00
Compare commits
9 Commits
copilot/fi
...
copilot/cr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d872b526f | ||
|
|
ed5c34735f | ||
|
|
45403ad402 | ||
|
|
26f5707977 | ||
|
|
9bcf9905d5 | ||
|
|
65c832e430 | ||
|
|
5caaf749f7 | ||
|
|
d5655376f6 | ||
|
|
19af34ae51 |
@@ -169,7 +169,7 @@ void Shell32::getSelectedFromDesktop(PWCHAR buffer)
|
||||
&pwba))))
|
||||
return;
|
||||
|
||||
if (HelperMethods::IsCursorActivated(0))
|
||||
if (HelperMethods::IsCursorActivated(reinterpret_cast<HWND>(LongToHandle(phwnd))))
|
||||
return;
|
||||
|
||||
CComPtr<IServiceProvider> psp;
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<PackageReference Include="WixToolset.Dtf.WindowsInstaller" Version="6.0.2" />
|
||||
<PackageReference Include="SharpZipLib" Version="1.4.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
<PackageReference Include="PureSharpCompress" Version="0.40.0" />
|
||||
<PackageReference Include="QuickLook.ApkReader" Version="2.1.0" />
|
||||
<PackageReference Include="QuickLook.DiscUtils" Version="1.0.0" />
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FreeTypeSharp" Version="3.0.1" />
|
||||
<PackageReference Include="QuickLook.Typography.OpenFont" Version="1.0.1" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3405.78">
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3537.50">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3405.78">
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3537.50">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -59,13 +59,13 @@
|
||||
<PackageReference Include="QuickLook.ImageGlass.WebP" Version="1.4.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.8.2">
|
||||
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.9.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3405.78">
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3537.50">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Google.Protobuf" Version="3.32.0">
|
||||
<PackageReference Include="Google.Protobuf" Version="3.33.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Memory" Version="4.6.3">
|
||||
|
||||
78
QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/Plugin.cs
Normal file
78
QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/Plugin.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
// Copyright © 2017-2025 QL-Win Contributors
|
||||
//
|
||||
// This file is part of QuickLook program.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using QuickLook.Common.Plugin;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace QuickLook.Plugin.InsvBlocker;
|
||||
|
||||
public class Plugin : IViewer
|
||||
{
|
||||
// Very high priority to ensure this plugin is checked before any other plugins
|
||||
// This prevents QuickLook from handling .insv files, allowing Insta360Studio's QuickLook to handle them instead
|
||||
public int Priority => int.MaxValue;
|
||||
|
||||
public void Init()
|
||||
{
|
||||
}
|
||||
|
||||
public bool CanHandle(string path)
|
||||
{
|
||||
// Match .insv files (Insta360 panoramic video files)
|
||||
if (Directory.Exists(path))
|
||||
return false;
|
||||
|
||||
return path.EndsWith(".insv", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public void Prepare(string path, ContextObject context)
|
||||
{
|
||||
// Set a minimal window size (1x1 pixels) to make the window as small as possible
|
||||
// This window will be closed immediately in View() before becoming visible
|
||||
context.PreferredSize = new Size { Width = 1, Height = 1 };
|
||||
}
|
||||
|
||||
public void View(string path, ContextObject context)
|
||||
{
|
||||
// Create an empty text block as content (required to avoid errors)
|
||||
var textBlock = new TextBlock
|
||||
{
|
||||
Text = "",
|
||||
Visibility = Visibility.Collapsed
|
||||
};
|
||||
context.ViewerContent = textBlock;
|
||||
context.IsBusy = false;
|
||||
|
||||
// Close the window immediately using Send priority for immediate execution
|
||||
// This prevents the window from becoming visible to the user
|
||||
Application.Current?.Dispatcher?.BeginInvoke(new Action(() =>
|
||||
{
|
||||
if (context.Source is Window window)
|
||||
{
|
||||
window.Close();
|
||||
}
|
||||
}), DispatcherPriority.Send);
|
||||
}
|
||||
|
||||
public void Cleanup()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
<TargetFramework>net462</TargetFramework>
|
||||
<RootNamespace>QuickLook.Plugin.InsvBlocker</RootNamespace>
|
||||
<AssemblyName>QuickLook.Plugin.InsvBlocker</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SignAssembly>false</SignAssembly>
|
||||
<UseWPF>true</UseWPF>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<ProjectGuid>{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Build\Debug\QuickLook.Plugin\QuickLook.Plugin.InsvBlocker\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\Build\Release\QuickLook.Plugin\QuickLook.Plugin.InsvBlocker\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Build\Debug\QuickLook.Plugin\QuickLook.Plugin.InsvBlocker\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\Build\Release\QuickLook.Plugin\QuickLook.Plugin.InsvBlocker\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\QuickLook.Common\QuickLook.Common.csproj">
|
||||
<Project>{85FDD6BA-871D-46C8-BD64-F6BB0CB5EA95}</Project>
|
||||
<Name>QuickLook.Common</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\GitVersion.cs">
|
||||
<Link>Properties\GitVersion.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
26
QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/README.md
Normal file
26
QuickLook.Plugin/QuickLook.Plugin.InsvBlocker/README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# QuickLook.Plugin.InsvBlocker
|
||||
|
||||
This plugin prevents QuickLook from handling `.insv` files (Insta360 panoramic video files).
|
||||
|
||||
## Purpose
|
||||
|
||||
Insta360Studio has its own QuickLook application with the same name and activation method (pressing spacebar). When both applications are installed, pressing space on `.insv` files would cause both QuickLook windows to appear, creating a conflict.
|
||||
|
||||
This plugin solves that issue by having QuickLook claim the file (via high priority) but immediately close without displaying anything, allowing Insta360Studio's QuickLook to handle the file instead.
|
||||
|
||||
## Implementation
|
||||
|
||||
- **Priority**: `int.MaxValue` (highest priority, checked before all other plugins)
|
||||
- **Behavior**:
|
||||
- Returns `true` for `CanHandle()` on files with `.insv` extension
|
||||
- Sets minimal window size (1x1 pixels) in `Prepare()`
|
||||
- Closes the window immediately in `View()` using `DispatcherPriority.Send`
|
||||
|
||||
## Technical Details
|
||||
|
||||
The plugin prevents the QuickLook window from becoming visible by:
|
||||
1. Matching `.insv` files with highest priority
|
||||
2. Setting a minimal window size to reduce visual impact if window briefly appears
|
||||
3. Closing the window immediately after content is set, before it becomes visible to the user
|
||||
|
||||
This approach ensures that Insta360Studio's QuickLook can handle the file without interference.
|
||||
@@ -55,7 +55,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MsgReader" Version="6.0.4" />
|
||||
<PackageReference Include="MsgReader" Version="6.0.5" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<ItemGroup>
|
||||
<PackageReference Include="UTF.Unknown" Version="2.6.0" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3405.78">
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3537.50">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="PdfiumViewer.Updated" Version="2.14.5" />
|
||||
<PackageReference Include="bblanchon.PDFiumV8.Win32" Version="141.0.7388" />
|
||||
<PackageReference Include="bblanchon.PDFiumV8.Win32" Version="143.0.7497" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -70,6 +70,8 @@ public partial class Plugin : IViewer, IMoreMenu
|
||||
|
||||
public void View(string path, ContextObject context)
|
||||
{
|
||||
_currentPath = path;
|
||||
|
||||
if (path.EndsWith(".rtf", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var rtfBox = new RichTextBox();
|
||||
@@ -86,7 +88,6 @@ public partial class Plugin : IViewer, IMoreMenu
|
||||
else
|
||||
{
|
||||
_tvp = new TextViewerPanel();
|
||||
_currentPath = path;
|
||||
_tvp.LoadFileAsync(path, context);
|
||||
context.ViewerContent = _tvp;
|
||||
}
|
||||
|
||||
@@ -89,6 +89,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickLook.Plugin.HelixViewe
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickLook.Plugin.MediaInfoViewer", "QuickLook.Plugin\QuickLook.Plugin.MediaInfoViewer\QuickLook.Plugin.MediaInfoViewer.csproj", "{B0054A16-472E-44AC-BA40-349303E524FF}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickLook.Plugin.InsvBlocker", "QuickLook.Plugin\QuickLook.Plugin.InsvBlocker\QuickLook.Plugin.InsvBlocker.csproj", "{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -289,6 +291,14 @@ Global
|
||||
{B0054A16-472E-44AC-BA40-349303E524FF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B0054A16-472E-44AC-BA40-349303E524FF}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{B0054A16-472E-44AC-BA40-349303E524FF}.Release|x64.Build.0 = Release|Any CPU
|
||||
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D}.Release|x64.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -315,6 +325,7 @@ Global
|
||||
{B4F7C88D-C79D-49E7-A1FB-FB69CF72585F} = {06EFDBE0-6408-4B37-BCF2-0CF9EBEA2E93}
|
||||
{311E6E78-3A5B-4E51-802A-5755BD5F9F97} = {06EFDBE0-6408-4B37-BCF2-0CF9EBEA2E93}
|
||||
{B0054A16-472E-44AC-BA40-349303E524FF} = {06EFDBE0-6408-4B37-BCF2-0CF9EBEA2E93}
|
||||
{A1B2C3D4-E5F6-4A5B-9C8D-7E6F5A4B3C2D} = {06EFDBE0-6408-4B37-BCF2-0CF9EBEA2E93}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {D3761C32-8C5F-498A-892B-3B0882994B62}
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>compile; runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3">
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Runtime.WindowsRuntime" Version="4.7.0">
|
||||
|
||||
@@ -77,6 +77,8 @@ Get it from one of the following sources:
|
||||
|
||||
Here is the complete list of plugins from [Available-Plugins](https://github.com/QL-Win/QuickLook/wiki/Available-Plugins).
|
||||
|
||||
See [here](https://github.com/QL-Win/QuickLook/wiki/Available-Plugins#how-to-install-or-upgrade-a-plugin) for instructions on how to install plugins.
|
||||
|
||||
## Supported file formats
|
||||
|
||||
See the [Supported formats](SUPPORTED_FORMATS.md)
|
||||
|
||||
Reference in New Issue
Block a user