]> git.saurik.com Git - cydget.git/commitdiff
Port state machine for menu button to 5.0.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 29 Feb 2012 01:31:56 +0000 (01:31 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 29 Feb 2012 01:31:56 +0000 (01:31 +0000)
Tweak.mm

index c4c0eb387c38ef7962e8839e1970f053396f66e1..21b26cb58adec677cfce6bea5f280182a6149151 100644 (file)
--- a/Tweak.mm
+++ b/Tweak.mm
@@ -150,11 +150,14 @@ MSInstanceMessageHook0(BOOL, SBAwayController, handleMenuButtonTap) {
     return YES;
 }
 
-MSInstanceMessageHook0(void, SBAwayController, _undimScreen) {
-    menu_ = false;
-    [[cydgets_ objectAtIndex:active_] enableCydget:self];
-    [[[self awayView] window] makeKeyWindow];
-    return MSOldCall();
+MSInstanceMessageHook0(void, SBAwayController, undimScreen) {
+    if ([self isDimmed]) {
+        menu_ = false;
+        [[cydgets_ objectAtIndex:active_] enableCydget:self];
+        [[[self awayView] window] makeKeyWindow];
+    }
+
+    MSOldCall();
 }
 
 static void Deactivate_(SBAwayController *self) {
@@ -167,7 +170,7 @@ MSInstanceMessageHook1(void, SBAwayController, dimScreen, BOOL, dim) {
     MSOldCall(dim);
 }
 
-MSInstanceMessageHook1(void, SpringBoard, menuButtonUp, GSEventRef, event) {
+MSInstanceMessageHook1(void, SpringBoard, menuButtonDown, GSEventRef, event) {
     menu_ = true;
     MSOldCall(event);
 }