Skip to content

Commit

Permalink
Mac: Fix issue with mouse move event not firing with latest Eto.
Browse files Browse the repository at this point in the history
  • Loading branch information
cwensley committed Oct 17, 2019
1 parent 5f47a3c commit ed57f3c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# use tabs by default for everything
[*.cs]
indent_style = tab
indent_size = 4
tab_size = 4
charset=utf-8
csharp_new_line_before_open_brace = all

[*.{csproj,vbproj,proj,targets,props}]
indent_style = space
indent_size = 2
tab_size = 2
12 changes: 8 additions & 4 deletions Eto.OpenTK.Mac/MacGLSurfaceHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
namespace Eto.OpenTK.Mac
{

public class MacGLSurfaceHandler : MacView<MacGLView8, GLSurface, GLSurface.ICallback>, GLSurface.IHandler
public class MacGLSurfaceHandler : MacView<MacGLView8, GLSurface, GLSurface.ICallback>, GLSurface.IHandler
{
static MacGLSurfaceHandler()
{
Toolkit.Init(new ToolkitOptions
{
Backend = PlatformBackend.PreferNative // prevent SDL2 from being detected if it is installed.
});
});
}

protected override void Initialize()
Expand Down Expand Up @@ -77,7 +77,7 @@ public override void Invalidate(bool invalidateChildren)

public override void Invalidate(Rectangle rect, bool invalidateChildren)
{
Control.NeedsNewContext = true;
Control.NeedsNewContext = true;
base.Invalidate(rect, invalidateChildren);
var needsDisplayInRect = rect.ToNS();
if (!Control.IsFlipped)
Expand All @@ -101,7 +101,11 @@ public override void AttachEvent(string id)
break;

case Eto.Forms.Control.SizeChangedEvent:
Control.SizeChanged += (sender, e) => Callback.OnSizeChanged(Widget, EventArgs.Empty);
Control.SizeChanged += (sender, e) =>
{
OnSizeChanged(EventArgs.Empty);
Callback.OnSizeChanged(Widget, EventArgs.Empty);
};
break;

default:
Expand Down

0 comments on commit ed57f3c

Please sign in to comment.