summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-02-07 16:04:07 +0100
committerMichael Lutz <michi@icosahedron.de>2021-02-13 22:21:17 +0100
commit9c8721922b13a6789c9fed971f8550bda3099f7a (patch)
tree302b540f329059fa43cdcc48fa69a0f5fedd089b
parent649ff5f9f9777e0c8b66e868d24af37af6c942be (diff)
downloadopenttd-9c8721922b13a6789c9fed971f8550bda3099f7a.tar.xz
Fix: [OSX] An emulated right mouse down event has to be followed by right mouse up.
-rw-r--r--src/video/cocoa/cocoa_wnd.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/video/cocoa/cocoa_wnd.mm b/src/video/cocoa/cocoa_wnd.mm
index 8c947fe04..5a3de7e55 100644
--- a/src/video/cocoa/cocoa_wnd.mm
+++ b/src/video/cocoa/cocoa_wnd.mm
@@ -451,6 +451,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
@implementation OTTD_CocoaView {
float _current_magnification;
NSUInteger _current_mods;
+ bool _emulated_down;
}
/**
@@ -564,6 +565,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
- (void)mouseDown:(NSEvent *)event
{
if ([ self emulateRightButton:event ]) {
+ self->_emulated_down = true;
[ self rightMouseDown:event ];
} else {
_left_button_down = true;
@@ -572,7 +574,7 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel
}
- (void)mouseUp:(NSEvent *)event
{
- if ([ self emulateRightButton:event ]) {
+ if (self->_emulated_down) {
[ self rightMouseUp:event ];
} else {
_left_button_down = false;