Commit Graph

881 Commits

Author SHA1 Message Date
amaitland 270b5c496e WinForms - Dispose of FrameworkCreated BrowserSettings when Control Disposed
If BrowserSettings is FrameworkCreated we dispose of the BrowserSettings object immediately,
this code was in ManagedCefBrowserAdapter::CreateBrowser, now it's duplicated in WPF/OffScreen

The WinForms version has a slightly different behaviour, we keep the browserSettings reference
until the Control is Disposed incase the Control handle is destroyed then Created again.

Issue #2840
2020-04-01 09:42:56 +10:00
amaitland 3ba0290676 WPF - Add IWebBrowser.IsBrowserInitialized explicit interface implementation
Can be called from any Thread, the ChromiumWebBrowser.IsBrowserInitialized property remains
as Dependency property.

Issue #3033
2020-03-26 09:10:36 +10:00
Gilberto Stankiewicz 29e6a6d03a Fix a typo in an error message (#3087) 2020-03-26 08:37:02 +10:00
billshinji 6fea930e3a WPF - IME Fix Korean character emitting issue (#3054)
*WPF IME  Fix Korean character emitting issue

Fixes a Korean IME related problem. A user cannot make a word or a sentence by progressing (producing) a single Korean character. Current experimental handler fails to 'emit' a composed Korean character.
2020-02-12 12:25:13 +10:00
amaitland 0c6290e709 WPF - InternalDispose add browser null check
It's possible to Dispose the browser before OnAfterBrowserCreated is called
resulting in a NRE when attempting to set WasHidden(true).

Resolves #3037
2020-02-01 20:33:08 +10:00
amaitland 499c6a80db WPF - ChromiumWebBrowser.GetBrowser() Throws InvalidOperationException if called on Non UI Thread.
- Extract error message out into a internal const so it's not duplicated
- Manually check InternalIsBrowserInitialized() method instead of using the extension method

Resolves #3032
2020-01-31 07:51:25 +10:00
amaitland 38c7941ab6 xml doc - remove seealso internal interface references 2020-01-29 10:22:17 +10:00
amaitland 79c99878c5 Xml Doc improvements 2020-01-29 05:37:45 +10:00
amaitland 19a70727f2 WinForms/WPF/OffScreen - Improve Dispose/BrowserInitialized error messaging
- Set CanExecuteJavascriptInMainFrame to false when disposing
- Throw exception if Disposed when calling GetBrowser method
- Improve error messaging
2020-01-15 11:16:06 +10:00
amaitland 57ab2ec982 WPF - Add CompositionTargetRenderHandler (experimental) 2019-12-13 21:07:25 +10:00
amaitland 5138c559be WPF - Disable GPU Compositing
Required until further Viz compositor related issues are resolves

https://bitbucket.org/chromiumembedded/cef/issues/2733/viz-osr-might-be-causing-some-graphic#comment-55006070
2019-12-04 09:05:54 +10:00
amaitland 21c89b130b WPF - Improve Mouse Scroll/Drag Usability (capture mouse outside of control)
Resolves #2258
2019-12-04 08:47:43 +10:00
Roh yeon jin b804367cb5 WPF IME - Fixed last hangul letter being duplicated (#2973)
WPF IME - Fixed the problem that the last hangul letter is duplicated.
2019-11-25 11:35:51 +10:00
amaitland c8469aea9d WPF - Add CreateBrowser method to allow for loading CefBrowser before attached to Visual Tree.
Commit https://github.com/cefsharp/CefSharp/commit/c88618e6638440f0150e0935d41872b2399ef6b2
added a new constructor overload, this adds a new CreateBrowser method that can be used in instances
when you need to attach an event handler or set a handler property before the browser is created.
2019-11-19 14:59:14 +10:00
amaitland c88618e663 WPF - Add ChromiumWebBrowser constructor overload for immediately loading the browser with set width/height 2019-11-17 18:38:24 +10:00
amaitland da0dfc46cb WPF - Change NotifyDpiChange to accept float instead of double
- Double was being cast to float
- If newDpi is same as old DPI do nothing, no extra floating point comparison is being used, so in some cases
it's possible the DPI change will be triggered when the DPI's are actually the same
2019-10-30 13:25:51 +10:00
amaitland b31a365dd4 WPF - Add basic touch support to ChromiumWebBrowser
- Touch support moved from ChromiumWebBrowserWithTouchSupport
- Stylus support was left in ChromiumWebBrowserWithTouchSupport as needs more testing

The CefSharp.Wpf.Example still has System.AppContext.SetSwitch("Switch.System.Windows.Input.Stylus.DisableStylusAndTouchSupport", true);
You will need to remove this for testing

Issue #228
2019-10-03 21:02:25 +10:00
amaitland 802bb7f43c Remove IAudioHandler
The Chromium implementation has changed so dramatically that CEF has removed support see https://bitbucket.org/chromiumembedded/cef/commits/1f893c76a97eaa88e3ff782b8e2e47dd0f5d27b2

Track https://bitbucket.org/chromiumembedded/cef/issues/2755/reimplement-audio-mirroring-for for details on when it will be reimplemented

Original Issue #2727
2019-10-01 20:06:37 +10:00
amaitland 518b4d286d WPF - Update Buffer xml doc
Buffer should only be used within the scope of the relevant event/method
2019-09-24 19:24:42 +10:00
amaitland 55c825efdc WPF - Add new DirectWritableBitmapRenderHandler implementation
Use as default when MultiThreadedMessageLoop = false
2019-09-07 15:41:13 +10:00
amaitland 6d438d6504 WPF - Add lock to AbstractRenderHandler Dispose
Was trying to avoid adding a lock, unfortunately it's still possible for the CopyMemory function to be called
after the MemoryMappedFile has been Disposed.
2019-09-07 15:12:59 +10:00
amaitland ea714b327c WPF - Additional RenderHandler Dispose Improvements
- Hide Browser when Disposing, reduce changes of RenderHandler being called
- Add additional IsDisposed check
- Set RenderHandler to null before Disposing
2019-09-07 14:02:10 +10:00
amaitland 00732e154b WPF - Improve ChromiumWebBrowser Dispose
- RenderHandler wasn't being disposed at all
- Used newer syntax for null Dispose calls
2019-09-07 12:52:14 +10:00
amaitland b1bd7499e5 WPF - Interop/WritableBitmapRenderHandler memory allocation improvement
If the MemoryMappedFile is smaller than we need then create a larger one
2019-09-07 12:15:49 +10:00
amaitland b1b930605c WPF - Replace RtlCopyMemory p/invoke with NativeMethodWrapper.MemoryCopy
- RtlCopyMemory only works on x64, we could use the slower RtlMoveMemory, going with a native wrapper around RtlCopyMemory
- Renamed CopyMemoryUsingHandle to MemoryCopy (cannot be CopyMemory or RtlCopyMemory as macro with that name already exists)

https://github.com/cefsharp/CefSharp/pull/2885#issuecomment-529033351

Issue #2885
2019-09-07 09:02:30 +10:00
Konstantin Preißer c311a581e6 WPF - Modify CopyMemory EntryPoint to work with .Net Core (#2885)
* Fix the entrypoint declaration for CopyMemory.

Contributes to #2796

* Follow-Up: Switch to RtlCopyMemory which is faster, but requires that the buffers do not overlap.
2019-09-06 13:15:47 +10:00
amaitland f088a7c169 CefSettings - Add custom dictionary to allow setting of command line args with no value
- Updated CefExample to remove "1" values from the command line arg examples

Issue #2858
2019-09-06 13:05:50 +10:00
amaitland df3315923e WPF - Add IWpfWebBrowser.Paint/VirtualKeyboardRequested events to interface 2019-09-05 12:35:12 +10:00
amaitland 07ac50064b WPF - Add NotifyDpiChange method
Extract DPI change code into a public method that can be called when the `WPF` window changes it's DPI
As we target .Net 4.5.2 we don't have access to the new managed DPI change notification that was added in WPF (.Net 4.6)

Resolves #2856
2019-08-24 07:40:32 +10:00
amaitland 130df919a7 WPF - Remove call to host.Invalidate
Was accidentally committed
2019-08-15 20:58:09 +10:00
amaitland 798e4635f8 Wpf - Fix Typo built instead of build 2019-08-02 20:14:02 +10:00
amaitland c9203c9310 WPF - Remove disable-gpu-compositing 2019-08-02 12:34:56 +10:00
amaitland e270d24214 WPF - OnWindowStateChanged only call WasHidden(false) when previous state was Minimized
Store the previous window state and only call IBrowserHost.WasHidden(false) if the browser was
previous hidden. Call isn't required when transitioning between Normal and Maximized
2019-07-27 21:36:30 +10:00
amaitland 75fc1737cd Rect - Change to use Math.Ceiling as that appears to match what CEF uses
cefclient uses Math.Floor though when I examine the values returned they're always one less
use use Math.Ceiling appears to match
2019-07-27 19:31:46 +10:00
amaitland ee30c90228 WPF - GetScreenInfo scale Rect/AvailableRect
Scale by DpiScaleFactor
2019-07-27 19:31:45 +10:00
amaitland 023dec2309 WPF - store width/height in local variable upon size change
Do this so it's easier to implement a workaround for #2779
2019-07-27 19:31:44 +10:00
Chen Huang 87bfa94862 Use Canvas.Top="0" for PART_image absolute position. (#2844)
Using Canvas.Bottom will cause glitchiness when resizing the browser.
On a height change, the height of the canvas changes first, and since
a new frame has not yet been rendered, PART_image still has the old
height, causing the image to jump around
2019-07-25 11:53:31 +10:00
amaitland 2bf8767c4b WPF - Update ZoomLevel xml doc re same origin
Issue #2834
2019-07-20 13:42:37 +10:00
Shaojun Li d70d3155f1 WPF - Fix and improve touch and stylus (#2817)
WPF - Improve Experimental Touch and stylus

- Send all points from stylus event instead of single, which can make handwriting smoother.
- Only send mouse events when stylus is null as WPF uses mouse emulation for stylus
2019-07-08 08:47:27 +10:00
amaitland 9eec7229a7 WPF - Disable GPU Compositing by default 2019-07-04 21:21:25 +10:00
amaitland 73a156fdc5 Initial version 75 upgrade and NetworkService changes
Compiles, that's about it at this point, there are major CEF breaking changes, and lots to be addressed.

Browser Process (main process)
- Removed IResourceHandlerFactory as it no longer fits with the structure that CEF provides
- New IResourceRequestHandler interface added, not plumbed in yet
- CefSettings - Add RootCachePath and ApplicationClientIdForFileScanning

BrowserSubprocess (render process)
- SendProcessMessage was moved from CefBrowser to CefFrame
- OnBrowserCreated added extraInfo param

The BrowserSubprocess changes for this upgrade should be complete
2019-06-25 19:24:57 +10:00
Alex Maitland 1a2c8ffcb6 Add CefSharp.PostMessage (#2799)
- JavascriptMessageReceived event added to ChromiumWebBrowser/IWebBrowser
- CefSharp.PostMessage and cefSharp.postMessage added to V8Context on creation for use in Javascript
- Add PostMessageTest.html
2019-06-03 21:08:03 +10:00
Michael Olsen ae94efa7df WPF Experimental - Fixed IME window not showing or showing at the wrong location (#2782)
* Fixed IME window not showing at all or sometimes showing at the wrong location.

* Added braces for code consistency.

* Added a few more braces for code consistency.

* Removed unnecessary local variable.

* Removed some implementation specific wording in a comment.
2019-05-31 07:22:31 +10:00
Alex Maitland 002edfb058 WPF - Add IME Support (#2757)
* WPF - Add initial IME implementation

* WPF - WpfImeKeyboardHandler handler code cleanup

- Restructure ImeHandler to be a static class as it really didn't maintain any state, now hwnd is passed in as param
- Renamed many of the methods to Ime for consistency (IME in all caps doesn't patch the naming convention used)
- The WpfIMEKeyboardHandler implementation is pretty much self contained now, only a single reference in ChromiumWebBrowser
also moved into Experimental folder/namespace
2019-05-04 12:32:38 +10:00
Alex Maitland 76e5a8d5c0 Add IAudioHandler (#2727)
* Feature Request - Add IAudioHandler

- For performance reasons we return NULL if no audiohandler is assigned
- No example is provided currently

Initial implementation for #2714
2019-05-03 12:54:40 +10:00
amaitland d8d392dff3 WPF - Make PartImageName/PartImagePopup name consts public for external use 2019-04-30 13:16:54 +10:00
amaitland 3d14f19867 WPF - Add Experimental ChromiumWebBrowserWithTouchSupport
Based on #2745

Original author https://github.com/GSonofNun
2019-04-26 08:14:45 +10:00
GSonofNun b5ee1e0beb WPF - Add TemplatePart Attributes to ChromiumBrowser (#2739) 2019-04-25 08:18:59 +10:00
amaitland cddece0cdc WPF - Add VirtualKeyboardRequested and corresponding VirtualKeyboardRequestedEventArgs 2019-04-06 11:48:33 +10:00
amaitland ea843f31c1 Formatting fixes
Follow up to #2691
2019-04-05 12:02:02 +10:00