From a637aa517daf07fc720f0d34b2bb29d5d6e8e744 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 22 Sep 2019 18:55:03 +1000 Subject: [PATCH] Get cursor position setting working with cocoa --- src/Window.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Window.c b/src/Window.c index 4078bbbfc..07f9ef506 100644 --- a/src/Window.c +++ b/src/Window.c @@ -1745,6 +1745,13 @@ void Clipboard_SetText(const String* value) { PasteboardPutItemFlavor(pbRef, 1, FMT_UTF8, cfData, 0); } +void Cursor_SetPosition(int x, int y) { + CGPoint point; + point.x = x + windowX; + point.y = y + windowY; + CGDisplayMoveCursorToPoint(CGMainDisplayID(), point); +} + void Window_OpenKeyboard(void) { } void Window_CloseKeyboard(void) { } @@ -2150,13 +2157,6 @@ static void Cursor_GetRawPos(int* x, int* y) { *x = (int)point.h; *y = (int)point.v; } -void Cursor_SetPosition(int x, int y) { - CGPoint point; - point.x = x + windowX; - point.y = y + windowY; - CGDisplayMoveCursorToPoint(CGMainDisplayID(), point); -} - static bool cursorVisible = true; void Cursor_SetVisible(bool visible) { if (visible) { @@ -3843,7 +3843,6 @@ void Window_ProcessEvents(void) { } static void Cursor_GetRawPos(int* x, int* y) { *x = 0; *y = 0; } -void Cursor_SetPosition(int x, int y) { } void Cursor_SetVisible(bool visible) { } void Window_ShowDialog(const char* title, const char* msg) {