]> git.saurik.com Git - veency.git/commitdiff
Remove the VNC cursor entirely, overwrite the upper-left corner, flush the CPU cache... v0.9.3146
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 28 Mar 2010 06:42:49 +0000 (06:42 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Sun, 28 Mar 2010 06:42:49 +0000 (06:42 +0000)
Tweak.mm
control

index de862ab98764ee126aa064d95164e572a6b7b73c..d3aa654f09f99e1172f1290dfc106ed1556fcee5 100644 (file)
--- a/Tweak.mm
+++ b/Tweak.mm
@@ -62,6 +62,8 @@
 #import <SpringBoard/SBDismissOnlyAlertItem.h>
 #import <SpringBoard/SBStatusBarController.h>
 
+extern "C" void CoreSurfaceBufferFlushProcessorCaches(CoreSurfaceBufferRef buffer);
+
 static size_t width_;
 static size_t height_;
 
@@ -80,9 +82,16 @@ static CFMessagePortRef ashikase_;
 static bool cursor_;
 
 static bool Ashikase(bool always) {
+    if (!always && !cursor_)
+        return false;
+
     if (ashikase_ == NULL)
         ashikase_ = CFMessagePortCreateRemote(kCFAllocatorDefault, CFSTR("jp.ashikase.mousesupport"));
-    return ashikase_ != NULL && (always || cursor_);
+    if (ashikase_ != NULL)
+        return true;
+
+    cursor_ = false;
+    return false;
 }
 
 static CFDataRef cfTrue_;
@@ -484,9 +493,7 @@ static void VNCSetup() {
     screen_->newClientHook = &VNCClient;
     screen_->passwordCheck = &VNCCheck;
 
-    char data[0], mask[0];
-    rfbCursorPtr cursor = rfbMakeXCursor(0, 0, data, mask);
-    rfbSetCursor(screen_, cursor);
+    screen_->cursor = NULL;
 }
 
 static void VNCEnabled() {
@@ -545,11 +552,17 @@ MSHook(kern_return_t, IOMobileFramebufferSwapSetLayer,
             VNCBlack();
         else {
             CoreSurfaceBufferLock(buffer, 2);
-            rfbPixel *data(reinterpret_cast<rfbPixel *>(CoreSurfaceBufferGetBaseAddress(buffer)));
+            volatile rfbPixel *data(reinterpret_cast<volatile rfbPixel *>(CoreSurfaceBufferGetBaseAddress(buffer)));
+
+            rfbPixel corner(data[0]);
+            data[0] = 0;
+            data[0] = corner;
+
             screen_->frameBuffer = const_cast<char *>(reinterpret_cast<volatile char *>(data));
             CoreSurfaceBufferUnlock(buffer);
         }
 
+        //CoreSurfaceBufferFlushProcessorCaches(buffer);
         rfbMarkRectAsModified(screen_, 0, 0, width_, height_);
     }
 
diff --git a/control b/control
index 05fc751ece6ce906e23f04fb8ba7bcd6e0ecbd07..ac534e8e0f12835c7a60e85bf1d893409747b94e 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.3145-1
+Version: 0.9.3146-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)