]> git.saurik.com Git - veency.git/commitdiff
Fix various mouse cursor position issues.
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 28 Mar 2010 00:05:16 +0000 (00:05 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 28 Mar 2010 00:05:16 +0000 (00:05 +0000)
Tweak.mm
control

index 4329106d4fc943d311b56e0caa5e522e2c455d4d..852ad7ef13dd3953d356a3e33d1f6e3e486644c8 100644 (file)
--- a/Tweak.mm
+++ b/Tweak.mm
@@ -101,25 +101,23 @@ typedef enum {
     MouseMessageTypeSetEnabled
 } MouseMessageType;
 
-static void AshikaseSetEnabled(bool enabled, bool always) {
-    if (!Ashikase(always))
-        return;
-
-    CFMessagePortSendRequest(ashikase_, MouseMessageTypeSetEnabled, cursor_ ? cfTrue_ : cfFalse_, 0, 0, NULL, NULL);
-}
-
-static bool AshikaseSendEvent(float x, float y, int buttons = 0) {
-    if (!Ashikase(false))
-        return false;
-
+static void AshikaseSendEvent(float x, float y, int buttons = 0) {
     event_.x = x;
     event_.y = y;
     event_.buttons = buttons;
     event_.absolute = true;
 
     CFMessagePortSendRequest(ashikase_, MouseMessageTypeEvent, cfEvent_, 0, 0, NULL, NULL);
+}
 
-    return true;
+static void AshikaseSetEnabled(bool enabled, bool always) {
+    if (!Ashikase(always))
+        return;
+
+    CFMessagePortSendRequest(ashikase_, MouseMessageTypeSetEnabled, enabled ? cfTrue_ : cfFalse_, 0, 0, NULL, NULL);
+
+    if (enabled)
+        AshikaseSendEvent(x_, y_);
 }
 
 MSClassHook(SBAlertItemsController)
@@ -230,10 +228,8 @@ static void VNCSettings() {
         NSNumber *cursor = [settings objectForKey:@"ShowCursor"];
         cursor_ = cursor == nil ? true : [cursor boolValue];
 
-        if (clients_ != 0) {
+        if (clients_ != 0)
             AshikaseSetEnabled(cursor_, true);
-            AshikaseSendEvent(x_, y_);
-        }
     }
 }
 
@@ -265,8 +261,10 @@ static void VNCPointer(int buttons, int x, int y, rfbClientPtr client) {
 
     rfbDefaultPtrAddEvent(buttons, x, y, client);
 
-    if (AshikaseSendEvent(x, y, buttons))
+    if (Ashikase(false)) {
+        AshikaseSendEvent(x, y, buttons);
         return;
+    }
 
     mach_port_t purple(0);
 
diff --git a/control b/control
index 69b494ba9e6ae880a51b107ad79c2e46f5315727..b7f4f5752a11405a513340f0523f54210f28c63d 100644 (file)
--- a/control
+++ b/control
@@ -5,7 +5,7 @@ Priority: optional
 Section: Networking
 Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
 Architecture: iphoneos-arm
-Version: 0.9.3143-1
+Version: 0.9.3144-1
 Description: a VNC /server/ for the iPhone
 Name: Veency
 Depends: mobilesubstrate (>= 0.9.2966-1), libvncserver, com.saurik.iphone.ske, preferenceloader, jp.ashikase.mousesupport | firmware (<< 3.0)