Browse Source

Merge branch 'master' into numerge

pull/2167/head
Jeremy Koritzinsky 8 years ago
committed by GitHub
parent
commit
fc0233742f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      native/Avalonia.Native/src/OSX/gl.mm
  2. 4
      src/Avalonia.Controls/Button.cs

6
native/Avalonia.Native/src/OSX/gl.mm

@ -208,9 +208,8 @@ public:
virtual ~AvnGlRenderingSession() virtual ~AvnGlRenderingSession()
{ {
glFlush();
[_context flushBuffer]; [_context flushBuffer];
[_context setView:nil]; [NSOpenGLContext clearCurrentContext];
CGLUnlockContext([_context CGLContextObj]); CGLUnlockContext([_context CGLContextObj]);
[_view unlockFocus]; [_view unlockFocus];
} }
@ -241,9 +240,8 @@ public:
auto gl = _context; auto gl = _context;
CGLLockContext([_context CGLContextObj]); CGLLockContext([_context CGLContextObj]);
[gl setView: _view]; [gl setView: _view];
[gl update];
[gl makeCurrentContext]; [gl makeCurrentContext];
auto frame = [_view frame];
*ret = new AvnGlRenderingSession(_window, _view, gl); *ret = new AvnGlRenderingSession(_window, _view, gl);
return S_OK; return S_OK;
} }

4
src/Avalonia.Controls/Button.cs

@ -253,10 +253,8 @@ namespace Avalonia.Controls
IsPressed = false; IsPressed = false;
e.Handled = true; e.Handled = true;
var hittest = this.GetVisualsAt(e.GetPosition(this));
if (ClickMode == ClickMode.Release && if (ClickMode == ClickMode.Release &&
hittest.Any(c => c == this || (c as IStyledElement)?.TemplatedParent == this)) this.GetVisualsAt(e.GetPosition(this)).Any(c => this == c || this.IsVisualAncestorOf(c)))
{ {
OnClick(); OnClick();
} }

Loading…
Cancel
Save