mirror of
				https://github.com/chylex/TweetDuck.git
				synced 2025-10-31 18:17:15 +01:00 
			
		
		
		
	Compare commits
	
		
			6 Commits
		
	
	
		
			1.23
			...
			c303346bc3
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| c303346bc3 | |||
| b9af966849 | |||
| 0a7459b72e | |||
| 9953f06ab1 | |||
| 0c8159aa79 | |||
| c785a7ed8c | 
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -12,6 +12,7 @@ bld/* | |||||||
| # Rider | # Rider | ||||||
| **/.idea/dictionaries | **/.idea/dictionaries | ||||||
| **/.idea/misc.xml | **/.idea/misc.xml | ||||||
|  | **/.idea/riderMarkupCache.xml | ||||||
|  |  | ||||||
| # User-specific files | # User-specific files | ||||||
| *.suo | *.suo | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ | |||||||
|     <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> |     <option name="PROJECT_ARGUMENTS_TRACKING" value="1" /> | ||||||
|     <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" /> |     <option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" /> | ||||||
|     <option name="PROJECT_KIND" value="DotNetCore" /> |     <option name="PROJECT_KIND" value="DotNetCore" /> | ||||||
|     <option name="PROJECT_TFM" value="net6.0-windows7.0" /> |     <option name="PROJECT_TFM" value="net7.0-windows" /> | ||||||
|     <method v="2"> |     <method v="2"> | ||||||
|       <option name="Build" /> |       <option name="Build" /> | ||||||
|     </method> |     </method> | ||||||
|   | |||||||
| @@ -6,6 +6,6 @@ using TweetDuck; | |||||||
| 
 | 
 | ||||||
| namespace TweetDuck { | namespace TweetDuck { | ||||||
| 	internal static class Version { | 	internal static class Version { | ||||||
| 		public const string Tag = "1.23"; | 		public const string Tag = "1.24"; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|   "sdk": { |   "sdk": { | ||||||
|     "version": "6.0.0", |     "version": "7.0.0", | ||||||
|     "rollForward": "latestMinor", |     "rollForward": "latestMinor", | ||||||
|     "allowPrerelease": false |     "allowPrerelease": false | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -1,10 +1,10 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|    |    | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0</TargetFramework> |     <TargetFramework>net7.0</TargetFramework> | ||||||
|     <Configurations>Debug;Release</Configurations> |     <Configurations>Debug;Release</Configurations> | ||||||
|     <Platforms>x86;x64</Platforms> |     <Platforms>x86;x64</Platforms> | ||||||
|     <LangVersion>10</LangVersion> |     <LangVersion>11</LangVersion> | ||||||
|     <Nullable>enable</Nullable> |     <Nullable>enable</Nullable> | ||||||
|     <GenerateAssemblyInfo>false</GenerateAssemblyInfo> |     <GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|   | |||||||
| @@ -1,10 +1,10 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|    |    | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0</TargetFramework> |     <TargetFramework>net7.0</TargetFramework> | ||||||
|     <Configurations>Debug;Release</Configurations> |     <Configurations>Debug;Release</Configurations> | ||||||
|     <Platforms>x86;x64</Platforms> |     <Platforms>x86;x64</Platforms> | ||||||
|     <LangVersion>10</LangVersion> |     <LangVersion>11</LangVersion> | ||||||
|     <Nullable>enable</Nullable> |     <Nullable>enable</Nullable> | ||||||
|     <GenerateAssemblyInfo>false</GenerateAssemblyInfo> |     <GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|   | |||||||
| @@ -1,9 +1,9 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|  |  | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0</TargetFramework> |     <TargetFramework>net7.0</TargetFramework> | ||||||
|     <Platforms>x86</Platforms> |     <Platforms>x86</Platforms> | ||||||
|     <LangVersion>10</LangVersion> |     <LangVersion>11</LangVersion> | ||||||
|     <Nullable>enable</Nullable> |     <Nullable>enable</Nullable> | ||||||
|     <GenerateAssemblyInfo>false</GenerateAssemblyInfo> |     <GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|   | |||||||
| @@ -1,10 +1,10 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|  |  | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0</TargetFramework> |     <TargetFramework>net7.0</TargetFramework> | ||||||
|     <Configurations>Debug;Release</Configurations> |     <Configurations>Debug;Release</Configurations> | ||||||
|     <Platforms>x86;x64</Platforms> |     <Platforms>x86;x64</Platforms> | ||||||
|     <LangVersion>10</LangVersion> |     <LangVersion>11</LangVersion> | ||||||
|     <Nullable>enable</Nullable> |     <Nullable>enable</Nullable> | ||||||
|     <GenerateAssemblyInfo>false</GenerateAssemblyInfo> |     <GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|   | |||||||
| @@ -1,10 +1,10 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|    |    | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0</TargetFramework> |     <TargetFramework>net7.0</TargetFramework> | ||||||
|     <Configurations>Debug;Release</Configurations> |     <Configurations>Debug;Release</Configurations> | ||||||
|     <Platforms>x86;x64</Platforms> |     <Platforms>x86;x64</Platforms> | ||||||
|     <LangVersion>10</LangVersion> |     <LangVersion>11</LangVersion> | ||||||
|     <Nullable>enable</Nullable> |     <Nullable>enable</Nullable> | ||||||
|     <GenerateAssemblyInfo>false</GenerateAssemblyInfo> |     <GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|   | |||||||
| @@ -1,19 +1,19 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|    |    | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0</TargetFramework> |     <TargetFramework>net7.0</TargetFramework> | ||||||
|     <Platforms>x86</Platforms> |     <Platforms>x86</Platforms> | ||||||
|     <RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers> |     <RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|    |    | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> |     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" /> | ||||||
|     <PackageReference Include="xunit" Version="2.4.1" /> |     <PackageReference Include="xunit" Version="2.4.2" /> | ||||||
|     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> |     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> | ||||||
|       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||||
|       <PrivateAssets>all</PrivateAssets> |       <PrivateAssets>all</PrivateAssets> | ||||||
|     </PackageReference> |     </PackageReference> | ||||||
|     <PackageReference Include="coverlet.collector" Version="3.1.0"> |     <PackageReference Include="coverlet.collector" Version="3.1.2"> | ||||||
|       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||||
|       <PrivateAssets>all</PrivateAssets> |       <PrivateAssets>all</PrivateAssets> | ||||||
|     </PackageReference> |     </PackageReference> | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ open Xunit | |||||||
| module RegexAccount = | module RegexAccount = | ||||||
|  |  | ||||||
|     module IsMatch = |     module IsMatch = | ||||||
|         let isMatch = TwitterUrls.RegexAccount.IsMatch |         let isMatch: string -> bool = TwitterUrls.RegexAccount.IsMatch | ||||||
|  |  | ||||||
|         [<Fact>] |         [<Fact>] | ||||||
|         let ``accepts HTTP protocol`` () = |         let ``accepts HTTP protocol`` () = | ||||||
|   | |||||||
| @@ -1,19 +1,19 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|    |    | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0</TargetFramework> |     <TargetFramework>net7.0</TargetFramework> | ||||||
|     <Platforms>x86</Platforms> |     <Platforms>x86</Platforms> | ||||||
|     <RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers> |     <RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|    |    | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> |     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" /> | ||||||
|     <PackageReference Include="xunit" Version="2.4.1" /> |     <PackageReference Include="xunit" Version="2.4.2" /> | ||||||
|     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> |     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> | ||||||
|       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||||
|       <PrivateAssets>all</PrivateAssets> |       <PrivateAssets>all</PrivateAssets> | ||||||
|     </PackageReference> |     </PackageReference> | ||||||
|     <PackageReference Include="coverlet.collector" Version="3.1.0"> |     <PackageReference Include="coverlet.collector" Version="3.1.2"> | ||||||
|       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||||
|       <PrivateAssets>all</PrivateAssets> |       <PrivateAssets>all</PrivateAssets> | ||||||
|     </PackageReference> |     </PackageReference> | ||||||
|   | |||||||
| @@ -1,19 +1,19 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|    |    | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0</TargetFramework> |     <TargetFramework>net7.0</TargetFramework> | ||||||
|     <Platforms>x86</Platforms> |     <Platforms>x86</Platforms> | ||||||
|     <RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers> |     <RuntimeIdentifiers>win7-x86;linux-x64</RuntimeIdentifiers> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|    |    | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> |     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" /> | ||||||
|     <PackageReference Include="xunit" Version="2.4.1" /> |     <PackageReference Include="xunit" Version="2.4.2" /> | ||||||
|     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> |     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> | ||||||
|       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||||
|       <PrivateAssets>all</PrivateAssets> |       <PrivateAssets>all</PrivateAssets> | ||||||
|     </PackageReference> |     </PackageReference> | ||||||
|     <PackageReference Include="coverlet.collector" Version="3.1.0"> |     <PackageReference Include="coverlet.collector" Version="3.1.2"> | ||||||
|       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||||
|       <PrivateAssets>all</PrivateAssets> |       <PrivateAssets>all</PrivateAssets> | ||||||
|     </PackageReference> |     </PackageReference> | ||||||
|   | |||||||
| @@ -1,10 +1,10 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|    |    | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0</TargetFramework> |     <TargetFramework>net7.0</TargetFramework> | ||||||
|     <Configurations>Debug;Release</Configurations> |     <Configurations>Debug;Release</Configurations> | ||||||
|     <Platforms>x64</Platforms> |     <Platforms>x64</Platforms> | ||||||
|     <LangVersion>10</LangVersion> |     <LangVersion>11</LangVersion> | ||||||
|     <OutputType>WinExe</OutputType> |     <OutputType>WinExe</OutputType> | ||||||
|     <Nullable>enable</Nullable> |     <Nullable>enable</Nullable> | ||||||
|     <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> |     <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> | ||||||
|   | |||||||
| @@ -1,10 +1,10 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|    |    | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0</TargetFramework> |     <TargetFramework>net7.0</TargetFramework> | ||||||
|     <Configurations>Debug;Release</Configurations> |     <Configurations>Debug;Release</Configurations> | ||||||
|     <Platforms>x64</Platforms> |     <Platforms>x64</Platforms> | ||||||
|     <LangVersion>10</LangVersion> |     <LangVersion>11</LangVersion> | ||||||
|     <Nullable>enable</Nullable> |     <Nullable>enable</Nullable> | ||||||
|     <GenerateAssemblyInfo>false</GenerateAssemblyInfo> |     <GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|   "sdk": { |   "sdk": { | ||||||
|     "version": "6.0.0", |     "version": "7.0.0", | ||||||
|     "rollForward": "latestMinor", |     "rollForward": "latestMinor", | ||||||
|     "allowPrerelease": false |     "allowPrerelease": false | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -1,11 +1,11 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|    |    | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0-windows</TargetFramework> |     <TargetFramework>net7.0-windows</TargetFramework> | ||||||
|     <Configurations>Debug;Release</Configurations> |     <Configurations>Debug;Release</Configurations> | ||||||
|     <Platforms>x86</Platforms> |     <Platforms>x86</Platforms> | ||||||
|     <RuntimeIdentifier>win7-x86</RuntimeIdentifier> |     <RuntimeIdentifier>win7-x86</RuntimeIdentifier> | ||||||
|     <LangVersion>10</LangVersion> |     <LangVersion>11</LangVersion> | ||||||
|     <Nullable>enable</Nullable> |     <Nullable>enable</Nullable> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|    |    | ||||||
| @@ -33,7 +33,7 @@ | |||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|    |    | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <PackageReference Include="CefSharp.WinForms.NETCore" Version="102.0.90" /> |     <PackageReference Include="CefSharp.WinForms.NETCore" Version="107.1.90" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|    |    | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|   | |||||||
| @@ -23,7 +23,7 @@ namespace TweetDuck.Video.Controls { | |||||||
| 
 | 
 | ||||||
| 				string? text = tooltipFunc(args); | 				string? text = tooltipFunc(args); | ||||||
| 
 | 
 | ||||||
| 				if (text == null) { | 				if (text == null || control.Parent == null) { | ||||||
| 					Visible = false; | 					Visible = false; | ||||||
| 					return; | 					return; | ||||||
| 				} | 				} | ||||||
|   | |||||||
| @@ -28,7 +28,7 @@ namespace TweetDuck.Video.Controls { | |||||||
| 				brushFore.Color = ForeColor; | 				brushFore.Color = ForeColor; | ||||||
| 				brushHover.Color = Color.FromArgb(128, ForeColor); | 				brushHover.Color = Color.FromArgb(128, ForeColor); | ||||||
| 				brushOverlap.Color = Color.FromArgb(80 + ForeColor.R * 11 / 16, 80 + ForeColor.G * 11 / 16, 80 + ForeColor.B * 11 / 16); | 				brushOverlap.Color = Color.FromArgb(80 + ForeColor.R * 11 / 16, 80 + ForeColor.G * 11 / 16, 80 + ForeColor.B * 11 / 16); | ||||||
| 				brushBack.Color = Parent.BackColor; | 				brushBack.Color = Parent?.BackColor ?? Color.Black; | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			Rectangle rect = new Rectangle(0, 0, Width, Height); | 			Rectangle rect = new Rectangle(0, 0, Width, Height); | ||||||
|   | |||||||
| @@ -1,11 +1,11 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|    |    | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0-windows</TargetFramework> |     <TargetFramework>net7.0-windows</TargetFramework> | ||||||
|     <Configurations>Debug;Release</Configurations> |     <Configurations>Debug;Release</Configurations> | ||||||
|     <Platforms>x86</Platforms> |     <Platforms>x86</Platforms> | ||||||
|     <RuntimeIdentifier>win7-x86</RuntimeIdentifier> |     <RuntimeIdentifier>win7-x86</RuntimeIdentifier> | ||||||
|     <LangVersion>10</LangVersion> |     <LangVersion>11</LangVersion> | ||||||
|     <Nullable>enable</Nullable> |     <Nullable>enable</Nullable> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|    |    | ||||||
|   | |||||||
| @@ -95,8 +95,8 @@ namespace TweetDuck.Controls { | |||||||
| 				form.WindowState = state.IsMaximized ? FormWindowState.Maximized : FormWindowState.Normal; | 				form.WindowState = state.IsMaximized ? FormWindowState.Maximized : FormWindowState.Normal; | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
| 			if ((state.Bounds == Rectangle.Empty && firstTimeFullscreen) || form.IsFullyOutsideView()) { | 			if (((state.Bounds == Rectangle.Empty && firstTimeFullscreen) || form.IsFullyOutsideView()) && Screen.PrimaryScreen is {} primaryScreen) { | ||||||
| 				form.DesktopBounds = Screen.PrimaryScreen.WorkingArea; | 				form.DesktopBounds = primaryScreen.WorkingArea; | ||||||
| 				form.WindowState = FormWindowState.Maximized; | 				form.WindowState = FormWindowState.Maximized; | ||||||
| 				state.Save(form); | 				state.Save(form); | ||||||
| 			} | 			} | ||||||
|   | |||||||
| @@ -28,7 +28,7 @@ namespace TweetDuck.Dialogs { | |||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		private void OnLinkClicked(object? sender, LinkLabelLinkClickedEventArgs e) { | 		private void OnLinkClicked(object? sender, LinkLabelLinkClickedEventArgs e) { | ||||||
| 			App.SystemHandler.OpenBrowser(e.Link.LinkData as string); | 			App.SystemHandler.OpenBrowser(e.Link?.LinkData as string); | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		private void FormAbout_HelpRequested(object? sender, HelpEventArgs hlpevent) { | 		private void FormAbout_HelpRequested(object? sender, HelpEventArgs hlpevent) { | ||||||
|   | |||||||
| @@ -1,11 +1,11 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|    |    | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0-windows</TargetFramework> |     <TargetFramework>net7.0-windows</TargetFramework> | ||||||
|     <Configurations>Debug;Release</Configurations> |     <Configurations>Debug;Release</Configurations> | ||||||
|     <Platforms>x86</Platforms> |     <Platforms>x86</Platforms> | ||||||
|     <RuntimeIdentifier>win7-x86</RuntimeIdentifier> |     <RuntimeIdentifier>win7-x86</RuntimeIdentifier> | ||||||
|     <LangVersion>10</LangVersion> |     <LangVersion>11</LangVersion> | ||||||
|     <Nullable>enable</Nullable> |     <Nullable>enable</Nullable> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|    |    | ||||||
| @@ -36,7 +36,7 @@ | |||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|    |    | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <PackageReference Include="CefSharp.WinForms.NETCore" Version="102.0.90" /> |     <PackageReference Include="CefSharp.WinForms.NETCore" Version="107.1.90" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|    |    | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|   | |||||||
| @@ -1,3 +1,4 @@ | |||||||
|  | using System.Diagnostics; | ||||||
| using CefSharp; | using CefSharp; | ||||||
| using CefSharp.Handler; | using CefSharp.Handler; | ||||||
| using TweetImpl.CefSharp.Adapters; | using TweetImpl.CefSharp.Adapters; | ||||||
| @@ -7,11 +8,11 @@ namespace TweetImpl.CefSharp.Handlers { | |||||||
| 	sealed class CefRequestHandler : RequestHandler { | 	sealed class CefRequestHandler : RequestHandler { | ||||||
| 		public RequestHandlerLogic<IRequest> Logic { get; } | 		public RequestHandlerLogic<IRequest> Logic { get; } | ||||||
| 
 | 
 | ||||||
| 		private readonly bool autoReload; | 		private readonly AutoReloader? autoReloader; | ||||||
| 
 | 
 | ||||||
| 		public CefRequestHandler(CefLifeSpanHandler lifeSpanHandler, bool autoReload) { | 		public CefRequestHandler(CefLifeSpanHandler lifeSpanHandler, bool autoReload) { | ||||||
| 			this.Logic = new RequestHandlerLogic<IRequest>(CefRequestAdapter.Instance, lifeSpanHandler.Logic); | 			this.Logic = new RequestHandlerLogic<IRequest>(CefRequestAdapter.Instance, lifeSpanHandler.Logic); | ||||||
| 			this.autoReload = autoReload; | 			this.autoReloader = autoReload ? new AutoReloader() : null; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		protected override bool OnBeforeBrowse(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool userGesture, bool isRedirect) { | 		protected override bool OnBeforeBrowse(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool userGesture, bool isRedirect) { | ||||||
| @@ -23,9 +24,31 @@ namespace TweetImpl.CefSharp.Handlers { | |||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		protected override void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status) { | 		protected override void OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status) { | ||||||
| 			if (autoReload) { | 			if (autoReloader?.RequestReload() == true) { | ||||||
| 				browser.Reload(); | 				browser.Reload(); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  | 
 | ||||||
|  | 		private sealed class AutoReloader { | ||||||
|  | 			private readonly Stopwatch lastReload = Stopwatch.StartNew(); | ||||||
|  | 			private int rapidReloadCount; | ||||||
|  | 			 | ||||||
|  | 			public bool RequestReload() { | ||||||
|  | 				if (rapidReloadCount >= 2) { | ||||||
|  | 					lastReload.Stop(); | ||||||
|  | 					return false; | ||||||
|  | 				} | ||||||
|  | 				 | ||||||
|  | 				if (lastReload.ElapsedMilliseconds < 5000) { | ||||||
|  | 					++rapidReloadCount; | ||||||
|  | 				} | ||||||
|  | 				else { | ||||||
|  | 					rapidReloadCount = 0; | ||||||
|  | 				} | ||||||
|  | 				 | ||||||
|  | 				lastReload.Restart(); | ||||||
|  | 				return true; | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,11 +1,11 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|    |    | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0-windows</TargetFramework> |     <TargetFramework>net7.0-windows</TargetFramework> | ||||||
|     <Configurations>Debug;Release</Configurations> |     <Configurations>Debug;Release</Configurations> | ||||||
|     <Platforms>x86</Platforms> |     <Platforms>x86</Platforms> | ||||||
|     <RuntimeIdentifier>win7-x86</RuntimeIdentifier> |     <RuntimeIdentifier>win7-x86</RuntimeIdentifier> | ||||||
|     <LangVersion>10</LangVersion> |     <LangVersion>11</LangVersion> | ||||||
|     <Nullable>enable</Nullable> |     <Nullable>enable</Nullable> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|    |    | ||||||
| @@ -28,7 +28,7 @@ | |||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|    |    | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <PackageReference Include="CefSharp.WinForms.NETCore" Version="102.0.90" /> |     <PackageReference Include="CefSharp.WinForms.NETCore" Version="107.1.90" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|    |    | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|   | |||||||
| @@ -1,11 +1,11 @@ | |||||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|    |    | ||||||
|   <PropertyGroup> |   <PropertyGroup> | ||||||
|     <TargetFramework>net6.0-windows</TargetFramework> |     <TargetFramework>net7.0-windows</TargetFramework> | ||||||
|     <Configurations>Debug;Release</Configurations> |     <Configurations>Debug;Release</Configurations> | ||||||
|     <Platforms>x86</Platforms> |     <Platforms>x86</Platforms> | ||||||
|     <RuntimeIdentifier>win7-x86</RuntimeIdentifier> |     <RuntimeIdentifier>win7-x86</RuntimeIdentifier> | ||||||
|     <LangVersion>10</LangVersion> |     <LangVersion>11</LangVersion> | ||||||
|     <Nullable>disable</Nullable> |     <Nullable>disable</Nullable> | ||||||
|     <GenerateAssemblyInfo>false</GenerateAssemblyInfo> |     <GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user