1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-09-14 10:32:10 +02:00

Compare commits

...

20 Commits
1.24 ... 1.25.4

Author SHA1 Message Date
c5a42e74d9 Release 1.25.4 2023-05-09 23:03:38 +02:00
23ebd58da0 Fix video player showing controls when cursor is above a different window
Closes #357
2023-03-18 13:48:29 +01:00
9a6394d079 Release 1.25.3 2023-03-09 20:28:03 +01:00
88a55c8795 Work around NullReferenceException when browser frame load events have a null URL
Closes #354
2023-03-09 20:28:03 +01:00
d406866a02 Hide button that enables the TweetDeck Preview 2023-03-09 20:18:40 +01:00
c2094bd2c0 Show error message if TweetDuck features fail to load, for example due to TweetDeck Preview
Closes #356
2023-03-09 20:17:59 +01:00
065b5a751b Release 1.25.2 2022-11-21 20:24:54 +01:00
0dc454e61f Re-add UCRT DLLs 2022-11-21 20:22:04 +01:00
416a43f0b1 Fix update installer not running as administrator due to breaking change in .NET 2022-11-21 20:07:23 +01:00
7a338076db Release 1.25.1 2022-11-21 08:09:55 +01:00
54bf1c2012 Make update installer delete unused files and folders 2022-11-21 08:09:55 +01:00
32681259f6 Re-add VC++ DLLs 2022-11-21 07:59:20 +01:00
1c1aa5ea44 Fix crash when right-clicking tray icon
Closes #350
2022-11-20 20:52:10 +01:00
da54af221c Release 1.25 2022-11-20 14:38:40 +01:00
6c8d518e0d Extract processor architecture to a variable in installer scripts 2022-11-20 14:38:40 +01:00
697f4f1569 Fix notification timer stopping permanently when the screen is locked while a notification is visible 2022-11-20 14:38:40 +01:00
15d4ec3228 Fix subprocess crashing because MSBuild is somehow copying wrong (not Large Address Aware) exe
Closes #342
2022-11-20 13:33:51 +01:00
c303346bc3 Halt reloading after subprocess crash if it happens too often 2022-11-20 08:04:53 +01:00
b9af966849 Update CefSharp to 107 2022-11-20 05:29:23 +01:00
0a7459b72e Update to .NET 7 2022-11-20 05:25:29 +01:00
94 changed files with 174 additions and 80 deletions

1
.gitignore vendored
View File

@@ -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

View File

@@ -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>

View File

@@ -6,6 +6,6 @@ using TweetDuck;
namespace TweetDuck { namespace TweetDuck {
internal static class Version { internal static class Version {
public const string Tag = "1.24"; public const string Tag = "1.25.4";
} }
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bld/Redist/concrt140.dll Normal file

Binary file not shown.

BIN
bld/Redist/msvcp140.dll Normal file

Binary file not shown.

BIN
bld/Redist/msvcp140_1.dll Normal file

Binary file not shown.

BIN
bld/Redist/msvcp140_2.dll Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bld/Redist/ucrtbase.dll Normal file

Binary file not shown.

BIN
bld/Redist/vccorlib140.dll Normal file

Binary file not shown.

BIN
bld/Redist/vcruntime140.dll Normal file

Binary file not shown.

View File

@@ -1,18 +1,21 @@
; Script generated by the Inno Script Studio Wizard. ; Script generated by the Inno Script Studio Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppID "8C25A716-7E11-4AAD-9992-8B5D0C78AE06"
#define MyAppName "TweetDuck" #define MyAppName "TweetDuck"
#define MyAppPublisher "chylex" #define MyAppPublisher "chylex"
#define MyAppURL "https://tweetduck.chylex.com" #define MyAppURL "https://tweetduck.chylex.com"
#define MyAppShortURL "https://td.chylex.com" #define MyAppShortURL "https://td.chylex.com"
#define MyAppExeName "TweetDuck.exe" #define MyAppExeName "TweetDuck.exe"
#define MyAppVersion GetFileVersion("..\windows\TweetDuck\bin\x86\Release\TweetDuck.exe") #define MyAppArchitecture "x86"
#define MyAppVersion GetFileVersion("..\windows\TweetDuck\bin\" + MyAppArchitecture + "\Release\TweetDuck.exe")
#include ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir") + "\idp.iss" #include ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir") + "\idp.iss"
[Setup] [Setup]
AppId={{8C25A716-7E11-4AAD-9992-8B5D0C78AE06} AppId={{{#MyAppID}}
AppName={#MyAppName} AppName={#MyAppName}
AppVersion={#MyAppVersion} AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion} AppVerName={#MyAppName} {#MyAppVersion}
@@ -43,8 +46,8 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalTasks}"; Flags: unchecked Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalTasks}"; Flags: unchecked
[Files] [Files]
Source: "..\windows\TweetDuck\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\windows\TweetDuck\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons] [Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable

View File

@@ -1,18 +1,21 @@
; Script generated by the Inno Script Studio Wizard. ; Script generated by the Inno Script Studio Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppID "8C25A716-7E11-4AAD-9992-8B5D0C78AE06"
#define MyAppName "TweetDuck" #define MyAppName "TweetDuck"
#define MyAppPublisher "chylex" #define MyAppPublisher "chylex"
#define MyAppURL "https://tweetduck.chylex.com" #define MyAppURL "https://tweetduck.chylex.com"
#define MyAppShortURL "https://td.chylex.com" #define MyAppShortURL "https://td.chylex.com"
#define MyAppExeName "TweetDuck.exe" #define MyAppExeName "TweetDuck.exe"
#define MyAppVersion GetFileVersion("..\windows\TweetDuck\bin\x86\Release\TweetDuck.exe") #define MyAppArchitecture "x86"
#define MyAppVersion GetFileVersion("..\windows\TweetDuck\bin\" + MyAppArchitecture + "\Release\TweetDuck.exe")
#include ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir") + "\idp.iss" #include ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir") + "\idp.iss"
[Setup] [Setup]
AppId={{8C25A716-7E11-4AAD-9992-8B5D0C78AE06} AppId={{{#MyAppID}}
AppName={#MyAppName} Portable AppName={#MyAppName} Portable
AppVersion={#MyAppVersion} AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion} AppVerName={#MyAppName} {#MyAppVersion}
@@ -40,8 +43,8 @@ MinVersion=0,6.1
Name: "english"; MessagesFile: "compiler:Default.isl" Name: "english"; MessagesFile: "compiler:Default.isl"
[Files] [Files]
Source: "..\windows\TweetDuck\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\windows\TweetDuck\bin\x86\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Run] [Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec skipifsilent Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall shellexec skipifsilent

View File

@@ -1,15 +1,17 @@
; Script generated by the Inno Script Studio Wizard. ; Script generated by the Inno Script Studio Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppID "8C25A716-7E11-4AAD-9992-8B5D0C78AE06"
#define MyAppName "TweetDuck" #define MyAppName "TweetDuck"
#define MyAppPublisher "chylex" #define MyAppPublisher "chylex"
#define MyAppURL "https://tweetduck.chylex.com" #define MyAppURL "https://tweetduck.chylex.com"
#define MyAppShortURL "https://td.chylex.com" #define MyAppShortURL "https://td.chylex.com"
#define MyAppExeName "TweetDuck.exe" #define MyAppExeName "TweetDuck.exe"
#define MyAppID "8C25A716-7E11-4AAD-9992-8B5D0C78AE06" #define MyAppArchitecture "x86"
#define MyAppVersion GetFileVersion("..\windows\TweetDuck\bin\x86\Release\TweetDuck.exe") #define MyAppVersion GetFileVersion("..\windows\TweetDuck\bin\" + MyAppArchitecture + "\Release\TweetDuck.exe")
#define CefVersion GetFileVersion("..\windows\TweetDuck\bin\x86\Release\libcef.dll") #define CefVersion GetFileVersion("..\windows\TweetDuck\bin\" + MyAppArchitecture + "\Release\libcef.dll")
#include ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir") + "\idp.iss" #include ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir") + "\idp.iss"
@@ -43,13 +45,13 @@ MinVersion=0,6.1
Name: "english"; MessagesFile: "compiler:Default.isl" Name: "english"; MessagesFile: "compiler:Default.isl"
[Files] [Files]
Source: "..\windows\TweetDuck\bin\x86\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\windows\TweetDuck\bin\x86\Release\TweetDuck.*"; DestDir: "{app}"; Flags: ignoreversion Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\TweetDuck.*"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\windows\TweetDuck\bin\x86\Release\TweetImpl.*"; DestDir: "{app}"; Flags: ignoreversion Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\TweetImpl.*"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\windows\TweetDuck\bin\x86\Release\TweetLib.*"; DestDir: "{app}"; Flags: ignoreversion Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\TweetLib.*"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\windows\TweetDuck\bin\x86\Release\guide\*.*"; DestDir: "{app}\guide"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\guide\*.*"; DestDir: "{app}\guide"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\windows\TweetDuck\bin\x86\Release\resources\*.*"; DestDir: "{app}\resources"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\resources\*.*"; DestDir: "{app}\resources"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\windows\TweetDuck\bin\x86\Release\plugins\*.*"; DestDir: "{app}\plugins"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\windows\TweetDuck\bin\{#MyAppArchitecture}\Release\plugins\*.*"; DestDir: "{app}\plugins"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons] [Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: TDIsUninstallable
@@ -69,16 +71,19 @@ Type: filesandordirs; Name: "{localappdata}\{#MyAppName}\GPUCache"
Type: files; Name: "{app}\CEFSHARP-LICENSE.txt" Type: files; Name: "{app}\CEFSHARP-LICENSE.txt"
Type: files; Name: "{app}\LICENSE.txt" Type: files; Name: "{app}\LICENSE.txt"
Type: files; Name: "{app}\README.txt" Type: files; Name: "{app}\README.txt"
Type: files; Name: "{app}\natives_blob.bin"
Type: files; Name: "{app}\cef.pak" Type: files; Name: "{app}\cef.pak"
Type: files; Name: "{app}\cef_100_percent.pak" Type: files; Name: "{app}\cef_100_percent.pak"
Type: files; Name: "{app}\cef_200_percent.pak" Type: files; Name: "{app}\cef_200_percent.pak"
Type: files; Name: "{app}\cef_extensions.pak" Type: files; Name: "{app}\cef_extensions.pak"
Type: files; Name: "{app}\devtools_resources.pak" Type: files; Name: "{app}\devtools_resources.pak"
Type: files; Name: "{app}\natives_blob.bin"
Type: files; Name: "{app}\dbgshim.dll"
Type: files; Name: "{app}\mscordaccore_x86_x86_6.*.dll"
Type: filesandordirs; Name: "{app}\guide" Type: filesandordirs; Name: "{app}\guide"
Type: filesandordirs; Name: "{app}\plugins\official" Type: filesandordirs; Name: "{app}\plugins\official"
Type: filesandordirs; Name: "{app}\resources" Type: filesandordirs; Name: "{app}\resources"
Type: filesandordirs; Name: "{app}\scripts" Type: filesandordirs; Name: "{app}\scripts"
Type: filesandordirs; Name: "{app}\swiftshader"
[Code] [Code]
function TDIsUninstallable: Boolean; forward; function TDIsUninstallable: Boolean; forward;

View File

@@ -1,6 +1,6 @@
{ {
"sdk": { "sdk": {
"version": "6.0.0", "version": "7.0.0",
"rollForward": "latestMinor", "rollForward": "latestMinor",
"allowPrerelease": false "allowPrerelease": false
} }

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -1,7 +1,7 @@
<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>

View File

@@ -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`` () =

View File

@@ -1,7 +1,7 @@
<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>

View File

@@ -1,7 +1,7 @@
<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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -1,6 +1,6 @@
{ {
"sdk": { "sdk": {
"version": "6.0.0", "version": "7.0.0",
"rollForward": "latestMinor", "rollForward": "latestMinor",
"allowPrerelease": false "allowPrerelease": false
} }

View File

@@ -67,6 +67,7 @@ import setup_tweet_context_menu from "./tweetdeck/setup_tweet_context_menu.js";
import setup_tweetduck_account_bamboozle from "./tweetdeck/setup_tweetduck_account_bamboozle.js"; import setup_tweetduck_account_bamboozle from "./tweetdeck/setup_tweetduck_account_bamboozle.js";
import setup_video_player from "./tweetdeck/setup_video_player.js"; import setup_video_player from "./tweetdeck/setup_video_player.js";
import skip_pre_login_page from "./tweetdeck/skip_pre_login_page.js"; import skip_pre_login_page from "./tweetdeck/skip_pre_login_page.js";
import tweetdeck_preview_warning from "./tweetdeck/tweetdeck_preview_warning.js";
import update from "./update/update.js"; import update from "./update/update.js";
const globalFunctions = [ const globalFunctions = [

View File

@@ -133,6 +133,14 @@ button {
bottom: 192px !important; bottom: 192px !important;
} }
/***********************/
/* Hide Preview button */
/***********************/
.js-gryphon-beta-btn {
display: none !important;
}
/*************************************/ /*************************************/
/* Tweak collapsed left panel layout */ /* Tweak collapsed left panel layout */
/*************************************/ /*************************************/

View File

@@ -0,0 +1,7 @@
import { $TD } from "../api/bridge.js";
export default function() {
if (!("TD" in window)) {
$TD.alert("warning", "Some TweetDuck features failed to load. This might happen if your Twitter account is enrolled into the TweetDeck Preview, which TweetDuck does not support. Try opting out of the TweetDeck Preview to restore TweetDuck's functionality.");
}
}

View File

@@ -1,17 +1,16 @@
<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>
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<UseWindowsForms>true</UseWindowsForms>
<RootNamespace>TweetDuck.Browser</RootNamespace> <RootNamespace>TweetDuck.Browser</RootNamespace>
<AssemblyName>TweetDuck.Browser</AssemblyName> <AssemblyName>TweetDuck.Browser</AssemblyName>
<ApplicationIcon>..\TweetDuck\Resources\Images\icon.ico</ApplicationIcon> <ApplicationIcon>..\TweetDuck\Resources\Images\icon.ico</ApplicationIcon>
@@ -33,14 +32,14 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="CefSharp.WinForms.NETCore" Version="105.3.330" /> <PackageReference Include="CefSharp.Common.NETCore" Version="107.1.90" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\Version.cs" Link="Version.cs" /> <Compile Include="..\..\Version.cs" Link="Version.cs" />
</ItemGroup> </ItemGroup>
<Target Name="CopyResources" AfterTargets="Build"> <Target Name="MakeBrowserProcessLargeAddressAware" AfterTargets="Build">
<Exec Command="call &quot;$(DevEnvDir)\..\..\VC\Auxiliary\Build\vcvars32.bat&quot; &amp; editbin /largeaddressaware /TSAWARE &quot;$(TargetDir)TweetDuck.Browser.exe&quot;" ContinueOnError="false" /> <Exec Command="call &quot;$(DevEnvDir)\..\..\VC\Auxiliary\Build\vcvars32.bat&quot; &amp; editbin /largeaddressaware /TSAWARE &quot;$(TargetDir)TweetDuck.Browser.exe&quot;" ContinueOnError="false" />
</Target> </Target>

View File

@@ -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;
} }

View File

@@ -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);

View File

@@ -237,7 +237,7 @@ namespace TweetDuck.Video {
int maxWidth = Math.Min(DpiScaled(media.imageSourceWidth), ownerWidth * 3 / 4); int maxWidth = Math.Min(DpiScaled(media.imageSourceWidth), ownerWidth * 3 / 4);
int maxHeight = Math.Min(DpiScaled(media.imageSourceHeight), ownerHeight * 3 / 4); int maxHeight = Math.Min(DpiScaled(media.imageSourceHeight), ownerHeight * 3 / 4);
bool isCursorInside = ClientRectangle.Contains(PointToClient(Cursor.Position)); bool isCursorInside = ClientRectangle.Contains(PointToClient(Cursor.Position)) && Handle == NativeMethods.GetFormHandleAt(Cursor.Position);
Size newSize = new Size(Math.Max(minWidth + 2, maxWidth), Math.Max(minHeight + 2, maxHeight)); Size newSize = new Size(Math.Max(minWidth + 2, maxWidth), Math.Max(minHeight + 2, maxHeight));
Point newLocation = new Point(ownerLeft + (ownerWidth - newSize.Width) / 2, ownerTop + (ownerHeight - newSize.Height + SystemInformation.CaptionHeight) / 2); Point newLocation = new Point(ownerLeft + (ownerWidth - newSize.Width) / 2, ownerTop + (ownerHeight - newSize.Height + SystemInformation.CaptionHeight) / 2);

View File

@@ -1,11 +1,13 @@
#nullable enable #nullable enable
using System; using System;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace TweetDuck.Video { namespace TweetDuck.Video {
[SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "InconsistentNaming")]
static class NativeMethods { static class NativeMethods {
private const int GA_ROOT = 2;
private const int GWL_HWNDPARENT = -8; private const int GWL_HWNDPARENT = -8;
[DllImport("user32.dll")] [DllImport("user32.dll")]
@@ -24,6 +26,12 @@ namespace TweetDuck.Video {
[DllImport("user32.dll")] [DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow(); public static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
private static extern IntPtr WindowFromPoint(Point point);
[DllImport("user32.dll")]
private static extern IntPtr GetAncestor(IntPtr hwnd, int flags);
[DllImport("user32.dll")] [DllImport("user32.dll")]
public static extern bool SetProcessDPIAware(); public static extern bool SetProcessDPIAware();
@@ -49,5 +57,10 @@ namespace TweetDuck.Video {
* ...so technically, this is following the documentation to the word. * ...so technically, this is following the documentation to the word.
*/ */
} }
public static IntPtr GetFormHandleAt(Point point) {
IntPtr window = WindowFromPoint(point);
return window == IntPtr.Zero ? IntPtr.Zero : GetAncestor(window, GA_ROOT);
}
} }
} }

View File

@@ -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>

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Controls;
using TweetDuck.Management; using TweetDuck.Management;
using TweetDuck.Utils; using TweetDuck.Utils;
using TweetLib.Browser.Interfaces; using TweetLib.Browser.Interfaces;
@@ -53,12 +54,12 @@ namespace TweetDuck.Browser.Notification {
} }
} }
private void WindowsSessionManager_LockStateChanged(object? sender, EventArgs e) { private void WindowsSessionManager_LockStateChanged(object? sender, bool isLocked) {
if (WindowsSessionManager.IsLocked) { if (isLocked) {
PauseNotification(NotificationPauseReason.WindowsSessionLocked); this.InvokeAsyncSafe(() => PauseNotification(NotificationPauseReason.WindowsSessionLocked));
} }
else { else {
ResumeNotification(NotificationPauseReason.WindowsSessionLocked); this.InvokeAsyncSafe(() => ResumeNotification(NotificationPauseReason.WindowsSessionLocked));
} }
} }

View File

@@ -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);
} }

View File

@@ -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) {

View File

@@ -4,8 +4,7 @@ using Win = System.Windows.Forms;
namespace TweetDuck.Management { namespace TweetDuck.Management {
static class WindowsSessionManager { static class WindowsSessionManager {
public static bool IsLocked { get; private set; } = false; public static event EventHandler<bool>? LockStateChanged;
public static event EventHandler? LockStateChanged;
public static void Register() { public static void Register() {
Win.Application.ApplicationExit += OnApplicationExit; Win.Application.ApplicationExit += OnApplicationExit;
@@ -27,8 +26,7 @@ namespace TweetDuck.Management {
} }
private static void SetLocked(bool newState) { private static void SetLocked(bool newState) {
IsLocked = newState; LockStateChanged?.Invoke(null, newState);
LockStateChanged?.Invoke(null, EventArgs.Empty);
} }
} }
} }

View File

@@ -45,6 +45,7 @@ namespace TweetDuck {
internal static void SetupWinForms() { internal static void SetupWinForms() {
Win.Application.EnableVisualStyles(); Win.Application.EnableVisualStyles();
Win.Application.SetCompatibleTextRenderingDefault(false); Win.Application.SetCompatibleTextRenderingDefault(false);
Win.LegacyWinForms.EnsureValid();
} }
[STAThread] [STAThread]

View File

@@ -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="105.3.330" /> <PackageReference Include="CefSharp.WinForms.NETCore" Version="107.1.90" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -78,12 +78,17 @@
<ResourcesPlugins Remove="$(SolutionDir)resources\Plugins\.debug\**\*.*" /> <ResourcesPlugins Remove="$(SolutionDir)resources\Plugins\.debug\**\*.*" />
<ResourcesPlugins Remove="$(SolutionDir)resources\Plugins\emoji-keyboard\emoji-instructions.txt" /> <ResourcesPlugins Remove="$(SolutionDir)resources\Plugins\emoji-keyboard\emoji-instructions.txt" />
<ResourcesPluginsDebug Include="$(SolutionDir)resources\Plugins\.debug\**\*.*" Visible="false" /> <ResourcesPluginsDebug Include="$(SolutionDir)resources\Plugins\.debug\**\*.*" Visible="false" />
<Redist Include="$(SolutionDir)bld\Redist\*.*" Visible="false" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>
<PreBuildEvent>powershell -NoProfile -Command "$ErrorActionPreference = 'SilentlyContinue'; (Get-Process TweetDuck.Browser | Where-Object {$_.Path -eq '$(TargetDir)TweetDuck.Browser.exe'}).Kill(); Exit 0"</PreBuildEvent> <PreBuildEvent>powershell -NoProfile -Command "$ErrorActionPreference = 'SilentlyContinue'; (Get-Process TweetDuck.Browser | Where-Object {$_.Path -eq '$(TargetDir)TweetDuck.Browser.exe'}).Kill(); Exit 0"</PreBuildEvent>
</PropertyGroup> </PropertyGroup>
<Target Name="MakeBrowserProcessLargeAddressAware" AfterTargets="Build">
<Exec Command="call &quot;$(DevEnvDir)\..\..\VC\Auxiliary\Build\vcvars32.bat&quot; &amp; editbin /largeaddressaware /TSAWARE &quot;$(TargetDir)TweetDuck.Browser.exe&quot;" ContinueOnError="false" />
</Target>
<Target Name="CopyResources" AfterTargets="Build"> <Target Name="CopyResources" AfterTargets="Build">
<ItemGroup> <ItemGroup>
<LocalesToDelete Include="$(TargetDir)locales\*.pak" Exclude="$(TargetDir)locales\en-US.pak" Visible="false" /> <LocalesToDelete Include="$(TargetDir)locales\*.pak" Exclude="$(TargetDir)locales\en-US.pak" Visible="false" />
@@ -120,6 +125,7 @@
<Copy SourceFiles="@(ResourcesContent)" DestinationFiles="@(ResourcesContent->'$(TargetDir)\resources\%(RecursiveDir)%(Filename)%(Extension)')" /> <Copy SourceFiles="@(ResourcesContent)" DestinationFiles="@(ResourcesContent->'$(TargetDir)\resources\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(ResourcesGuide)" DestinationFiles="@(ResourcesGuide->'$(TargetDir)\guide\%(RecursiveDir)%(Filename)%(Extension)')" /> <Copy SourceFiles="@(ResourcesGuide)" DestinationFiles="@(ResourcesGuide->'$(TargetDir)\guide\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(ResourcesPlugins)" DestinationFiles="@(ResourcesPlugins->'$(TargetDir)\plugins\official\%(RecursiveDir)%(Filename)%(Extension)')" /> <Copy SourceFiles="@(ResourcesPlugins)" DestinationFiles="@(ResourcesPlugins->'$(TargetDir)\plugins\official\%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(Redist)" DestinationFolder="$(TargetDir)" />
<Exec Command="powershell -NoProfile -ExecutionPolicy Unrestricted -File &quot;$(ProjectDir)Resources\PostBuild.ps1&quot; &quot;$(TargetDir)\&quot;" IgnoreExitCode="false" /> <Exec Command="powershell -NoProfile -ExecutionPolicy Unrestricted -File &quot;$(ProjectDir)Resources\PostBuild.ps1&quot; &quot;$(TargetDir)\&quot;" IgnoreExitCode="false" />
</Target> </Target>

View File

@@ -23,6 +23,7 @@ namespace TweetDuck.Updates {
FileName = Path, FileName = Path,
Arguments = arguments, Arguments = arguments,
Verb = runElevated ? "runas" : string.Empty, Verb = runElevated ? "runas" : string.Empty,
UseShellExecute = true,
ErrorDialog = true ErrorDialog = true
})) { })) {
return true; return true;

View File

@@ -59,11 +59,15 @@ namespace TweetImpl.CefSharp.Component {
} }
private void OnFrameLoadStart(object? sender, FrameLoadStartEventArgs e) { private void OnFrameLoadStart(object? sender, FrameLoadStartEventArgs e) {
base.OnFrameLoadStart(e.Url, e.Frame); if (!string.IsNullOrEmpty(e.Url)) {
base.OnFrameLoadStart(e.Url, e.Frame);
}
} }
private void OnFrameLoadEnd(object? sender, FrameLoadEndEventArgs e) { private void OnFrameLoadEnd(object? sender, FrameLoadEndEventArgs e) {
base.OnFrameLoadEnd(e.Url, e.Frame); if (!string.IsNullOrEmpty(e.Url)) {
base.OnFrameLoadEnd(e.Url, e.Frame);
}
} }
} }
} }

View File

@@ -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;
}
}
} }
} }

View File

@@ -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="105.3.330" /> <PackageReference Include="CefSharp.WinForms.NETCore" Version="107.1.90" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -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>

View File

@@ -4,10 +4,16 @@ using System.Reflection;
namespace System.Windows.Forms { namespace System.Windows.Forms {
internal sealed class Command2 { internal sealed class Command2 {
private static readonly Type Type = typeof(Form).Assembly.GetType("System.Windows.Forms.Command"); private static readonly Type Type = typeof(Form).Assembly.GetType("System.Windows.Forms.Command");
private static readonly ConstructorInfo Constructor = Type.GetConstructor(new Type[] { typeof(ICommandExecutor) }) ?? throw new NullReferenceException(); private static readonly ConstructorInfo Constructor = Type.GetConstructor(new Type[] { typeof(ICommandExecutor) });
private static readonly MethodInfo DisposeMethod = Type.GetMethod("Dispose", BindingFlags.Instance | BindingFlags.Public) ?? throw new NullReferenceException(); private static readonly MethodInfo DisposeMethod = Type.GetMethod("Dispose", BindingFlags.Instance | BindingFlags.Public);
private static readonly PropertyInfo IDProperty = Type.GetProperty("ID") ?? throw new NullReferenceException(); private static readonly PropertyInfo IDProperty = Type.GetProperty("ID");
internal static void EnsureValid() {
if (Constructor == null || DisposeMethod == null || IDProperty == null) {
throw new InvalidOperationException();
}
}
public int ID { get; } public int ID { get; }
private readonly object cmd; private readonly object cmd;

View File

@@ -7,8 +7,14 @@ using System.Runtime.InteropServices;
namespace System.Windows.Forms { namespace System.Windows.Forms {
public sealed class ContextMenu : Menu { public sealed class ContextMenu : Menu {
private static readonly FieldInfo NotifyIconWindowField = typeof(NotifyIcon).GetField("window", BindingFlags.Instance | BindingFlags.NonPublic) ?? throw new InvalidOperationException(); private static readonly FieldInfo NotifyIconWindowField = typeof(NotifyIcon).GetField("_window", BindingFlags.Instance | BindingFlags.NonPublic);
internal static void EnsureValid() {
if (NotifyIconWindowField == null) {
throw new InvalidOperationException();
}
}
public event EventHandler Popup; public event EventHandler Popup;
public void Show(Control control, Point pos) { public void Show(Control control, Point pos) {

View File

@@ -0,0 +1,8 @@
namespace System.Windows.Forms;
public static class LegacyWinForms {
public static void EnsureValid() {
Command2.EnsureValid();
ContextMenu.EnsureValid();
}
}