Skip to content

Commit

Permalink
disable default drag handling
Browse files Browse the repository at this point in the history
  • Loading branch information
pypy-vrc committed Jun 28, 2020
1 parent 9b6b42e commit 88990fd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public MainForm()
// Application.StartupPath + "/html/index.html"
Browser = new ChromiumWebBrowser(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "html/index.html"))
{
DragHandler = new NoopDragHandler(),
BrowserSettings =
{
// UniversalAccessFromFileUrls = CefState.Enabled,
Expand Down
23 changes: 23 additions & 0 deletions NoopDragHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright(c) 2019 pypy. All rights reserved.
//
// This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>.

using System.Collections.Generic;
using CefSharp;
using CefSharp.Enums;

namespace VRCX
{
public class NoopDragHandler : IDragHandler
{
bool IDragHandler.OnDragEnter(IWebBrowser chromiumWebBrowser, IBrowser browser, IDragData dragData, DragOperationsMask mask)
{
return true;
}

void IDragHandler.OnDraggableRegionsChanged(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IList<DraggableRegion> regions)
{
}
}
}
1 change: 1 addition & 0 deletions VRCX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
<Compile Include="Discord.cs" />
<Compile Include="CpuMonitor.cs" />
<Compile Include="Browser.cs" />
<Compile Include="NoopDragHandler.cs" />
<Compile Include="RenderHandler.cs" />
<Compile Include="SQLite.cs" />
<Compile Include="VRForm.cs">
Expand Down
2 changes: 2 additions & 0 deletions VRForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public VRForm()
//
Browser1 = new ChromiumWebBrowser(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "html/vr.html?1"))
{
DragHandler = new NoopDragHandler(),
BrowserSettings =
{
// UniversalAccessFromFileUrls = CefState.Enabled,
Expand All @@ -33,6 +34,7 @@ public VRForm()
};
Browser2 = new ChromiumWebBrowser(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "html/vr.html?2"))
{
DragHandler = new NoopDragHandler(),
BrowserSettings =
{
// UniversalAccessFromFileUrls = CefState.Enabled,
Expand Down

0 comments on commit 88990fd

Please sign in to comment.