1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-25 04:29:09 +00:00

Ensures mouse button presses propagate correctly.

Beyond the one that initiates mouse capture, that is.
This commit is contained in:
Thomas Harte 2019-07-02 16:57:51 -04:00
parent b9c2c42bc0
commit 387be4a0a6

View File

@ -276,10 +276,12 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
#pragma mark - Mouse buttons #pragma mark - Mouse buttons
- (void)applyButtonDown:(NSEvent *)event { - (void)applyButtonDown:(NSEvent *)event {
if(self.shouldCaptureMouse && !_mouseIsCaptured) { if(self.shouldCaptureMouse) {
_mouseIsCaptured = YES; if(!_mouseIsCaptured) {
[NSCursor hide]; _mouseIsCaptured = YES;
CGAssociateMouseAndMouseCursorPosition(false); [NSCursor hide];
CGAssociateMouseAndMouseCursorPosition(false);
}
[self.responderDelegate mouseDown:event]; [self.responderDelegate mouseDown:event];
} }