aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-27 17:46:36 +0000
committerDavid Robillard <d@drobilla.net>2014-01-27 17:46:36 +0000
commitcae7d9e86a54721f516d746adb9a94ca92a32b3e (patch)
tree37f8a8e290efea5283b280793d392d957aa11b54
parent1b5e7346a449c45495032e9546b145a8da114b7b (diff)
Apply some OSX fixes from Ben Loftis.
-rw-r--r--pugl/pugl_osx.m16
1 files changed, 15 insertions, 1 deletions
diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m
index d091a11..285d299 100644
--- a/pugl/pugl_osx.m
+++ b/pugl/pugl_osx.m
@@ -99,6 +99,7 @@ puglDisplay(PuglView* view)
- (void) mouseDragged:(NSEvent*)event;
- (void) mouseDown:(NSEvent*)event;
- (void) mouseUp:(NSEvent*)event;
+- (void) rightMouseDragged:(NSEvent*)event;
- (void) rightMouseDown:(NSEvent*)event;
- (void) rightMouseUp:(NSEvent*)event;
- (void) keyDown:(NSEvent*)event;
@@ -233,6 +234,15 @@ getModifiers(PuglView* view, NSEvent* ev)
}
}
+- (void) rightMouseDragged:(NSEvent*)event
+{
+ if (puglview->motionFunc) {
+ NSPoint loc = [event locationInWindow];
+ puglview->mods = getModifiers(puglview, event);
+ puglview->motionFunc(puglview, loc.x, puglview->height - loc.y);
+ }
+}
+
- (void) mouseDown:(NSEvent*)event
{
if (puglview->mouseFunc) {
@@ -303,7 +313,7 @@ getModifiers(PuglView* view, NSEvent* ev)
- (void) flagsChanged:(NSEvent*)event
{
if (puglview->specialFunc) {
- const unsigned mods = getModifiers(puglview, [event modifierFlags]);
+ const unsigned mods = getModifiers(puglview, event);
if ((mods & PUGL_MOD_SHIFT) != (puglview->mods & PUGL_MOD_SHIFT)) {
puglview->specialFunc(puglview, mods & PUGL_MOD_SHIFT, PUGL_KEY_SHIFT);
} else if ((mods & PUGL_MOD_CTRL) != (puglview->mods & PUGL_MOD_CTRL)) {
@@ -365,6 +375,10 @@ puglCreate(PuglNativeWindow parent,
[window makeKeyAndOrderFront:window];
+ if (!visible) {
+ [window setIsVisible:NO];
+ }
+
return view;
}