From: Jay Freeman (saurik) Date: Wed, 29 Feb 2012 01:31:56 +0000 (+0000) Subject: Port state machine for menu button to 5.0. X-Git-Tag: v0.9.4004~6 X-Git-Url: https://git.saurik.com/cydget.git/commitdiff_plain/f83bba741b3b1647c986262ef8136435962e67a4 Port state machine for menu button to 5.0. --- diff --git a/Tweak.mm b/Tweak.mm index c4c0eb3..21b26cb 100644 --- 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); }