Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

Commit

Permalink
DWM frameless option removed. Fixing issue chromelyapps/Chromely#266.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkol committed Dec 12, 2020
1 parent aa1390c commit 500aa06
Show file tree
Hide file tree
Showing 30 changed files with 1,163 additions and 1,125 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<!-- <TargetFramework>netcoreapp3.1</TargetFramework> -->
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Platforms>x86;x64</Platforms>
<Platforms>x64</Platforms>
<ApplicationIcon>chromely.ico</ApplicationIcon>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Chromely.CefSharp.Tests/Chromely.CefSharp.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>

Expand Down
8 changes: 0 additions & 8 deletions src/Chromely.CefSharp.Tests/Class1.cs

This file was deleted.

15 changes: 11 additions & 4 deletions src/Chromely.CefSharp/Browser/ChromiumBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using CefSharp;
using CefSharp.Internals;
using Chromely.Core.Configuration;
using Chromely.Core.Host;
using Chromely.Core.Logging;
using Microsoft.Extensions.Logging;
using static Chromely.Interop.User32;
Expand Down Expand Up @@ -77,12 +78,15 @@ public abstract partial class ChromiumBrowser : IWebBrowserInternal
/// <summary>
/// Initializes a new instance of the <see cref="ChromiumBrowser"/> class.
/// </summary>
public ChromiumBrowser(IChromelyConfiguration config)
public ChromiumBrowser(IChromelyNativeHost nativeHost, IChromelyConfiguration config)
{
NativeHost = nativeHost;
_config = config;
CefSharpSettings.LegacyJavascriptBindingEnabled = false;
}

public IChromelyNativeHost NativeHost { get; private set; }

public void Initialize(CefSettings settings)
{
_settings = settings;
Expand Down Expand Up @@ -519,8 +523,8 @@ void IWebBrowserInternal.OnAfterBrowserCreated(IBrowser browser)
_browser = browser;
IsBrowserInitialized = true;

//If Load was called after the call to CreateBrowser we'll call Load
//on the MainFrame
// If Load was called after the call to CreateBrowser we'll call Load
// on the MainFrame
if (!_initialAddressLoaded && !string.IsNullOrEmpty(Address))
{
browser.MainFrame.LoadUrl(Address);
Expand All @@ -529,7 +533,7 @@ void IWebBrowserInternal.OnAfterBrowserCreated(IBrowser browser)
var host = this.GetBrowserHost();
_browserWindowHandle = host.GetWindowHandle();

//Set Javascript execution
// Set Javascript execution
this._config.JavaScriptExecutor = new DefaultJavaScriptExecutor(_browser);

IsBrowserInitializedChanged?.Invoke(this, EventArgs.Empty);
Expand Down Expand Up @@ -625,6 +629,9 @@ void IWebBrowserInternal.OnFrameLoadEnd(FrameLoadEndEventArgs args)
{
handler(this, args);
}

// Setup window subclass to intercept message for frameless window dragging
NativeHost.SetupMessageInterceptor(_browserWindowHandle);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void IDragHandler.OnDraggableRegionsChanged(IWebBrowser ChromiumBrowser, IBrowse
{
lock (objLock)
{
framelessOption.IsDraggable = (point) =>
framelessOption.IsDraggable = (nativeHost, point) =>
{
var hitNoDrag = regions.Any(r => !r.Draggable && ContainsPoint(r, point));
if (hitNoDrag)
Expand Down
20 changes: 12 additions & 8 deletions src/Chromely.CefSharp/Chromely.CefSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<CefSharpAnyCpuSupport>true</CefSharpAnyCpuSupport>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
<ProductVersion>5.1.83.0</ProductVersion>
<AssemblyVersion>5.1.83.0</AssemblyVersion>
<FileVersion>5.1.83.0</FileVersion>
<Version>5.1.83.0</Version>
<ProductVersion>5.1.83.2</ProductVersion>
<AssemblyVersion>5.1.83.2</AssemblyVersion>
<FileVersion>5.1.83.2</FileVersion>
<Version>5.1.83.2</Version>
<Authors>Chromely Projects</Authors>
<Company>Chromely Projects</Company>
<Description>Chromely CefSharp implementation - this is in NetStandard as it can be used in both .NET Framework, .NET Core 3 and .NET 5 (Windows Only). Chromely.CefSharp version naming is based Chromely and Chromium versions implemented- major.minor.chromuim version.patch e.g 1.0.71.0.</Description>
Expand All @@ -19,9 +19,8 @@
<PackageTags>CEF Chromium HTML5 Desktop Chromely CefSharp NetStandard .NET Core 3 .NET 5</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageReleaseNotes>
- Upgrade to v5.1 - https://github.com/chromelyapps/Chromely/issues/225.
- Fixes for Fullscreen/Kiosk modes - https://github.com/chromelyapps/CefSharp/commit/cf9eb16976f707981770aba0d60f0281e86a3247
- Adding a configurable option - UseOnlyCefMessageLoop - https://github.com/chromelyapps/CefSharp/commit/29b26f293baea1430d4f2f1990a79d7416041a39
- Breaking changes.
- Fixes for frameless window - https://github.com/chromelyapps/Chromely/issues/266
</PackageReleaseNotes>
<RepositoryType>Github Repository</RepositoryType>
<RepositoryUrl>https://github.com/chromelyapps/CefSharp</RepositoryUrl>
Expand All @@ -44,7 +43,6 @@

<ItemGroup>
<PackageReference Include="CefSharp.Common" Version="83.4.20" />
<PackageReference Include="Chromely.Core" Version="5.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.5" />
<PackageReference Include="Microsoft.CSharp" Version="4.6.0" />
Expand All @@ -56,4 +54,10 @@
<None Include="chromely.png" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<Reference Include="Chromely.Core">
<HintPath>..\Chromely.Core\Chromely.Core.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/Chromely.CefSharp/ChromelyAppBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Chromely.CefSharp
{
public abstract class ChromelyAppBase : ChromelyApp
{
public override void ConfigureCoreServices(ServiceCollection services)
public override void ConfigureCoreServices(IServiceCollection services)
{
base.ConfigureCoreServices(services);

Expand All @@ -32,7 +32,7 @@ public override void ConfigureCoreServices(ServiceCollection services)
services.TryAddSingleton<ChromelyWindowController, WindowController>();
}

public sealed override void ConfigureDefaultHandlers(ServiceCollection services)
public sealed override void ConfigureDefaultHandlers(IServiceCollection services)
{
base.ConfigureDefaultHandlers(services);

Expand Down
6 changes: 4 additions & 2 deletions src/Chromely.CefSharp/ChromelyBasicApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ namespace Chromely.CefSharp
/// </summary>
public class ChromelyBasicApp: ChromelyAppBase
{
public sealed override void ConfigureCoreServices(ServiceCollection services)
public sealed override void ConfigureCoreServices(IServiceCollection services)
{
base.ConfigureCoreServices(services);
services.TryAddSingleton<IChromelyNativeHost, ChromelyHost>();
services.TryAddSingleton<IWindowMessageInterceptor, DefaultWindowMessageInterceptor>();
services.TryAddSingleton<IKeyboadHookHandler, DefaulKeyboadHookHandler>();
services.TryAddSingleton<IChromelyNativeHost, ChromelyWinHost>();
}
}
}
23 changes: 0 additions & 23 deletions src/Chromely.CefSharp/ChromelyFramelessApp.cs

This file was deleted.

Loading

0 comments on commit 500aa06

Please sign in to comment.