insanj / Bluepicker

🕹 Control Bluetooth devices via Activator.
http://insanj.github.io/Bluepicker
GNU General Public License v3.0
16 stars 2 forks source link

Dialog is hidden beyond application. #2

Closed czbird77 closed 9 years ago

czbird77 commented 10 years ago

When invoking bluepicker from home screen, everything is OK. But when invoking bluepicker when another another application is open (e.g. safari), the bluetooth gets started (icon shows in the status bar) but the device selection dialog is shown behind the application window, so that it is inaccessible. Please make the dialog go to front.

Device: iPad mini 2, iOS 7.0.4 Activator action: slide right on status bar

insanj commented 10 years ago

Unfortunately, I couldn't replicate this issue. Have you tried checking to see if it's another tweak conflicting? I don't have an iPad on-hand, so it could be isolated to your device model, but I would've hoped to receive another report of this bug (yours is the only one).

iPhone Bluepicker Sheet In-App

czbird77 commented 10 years ago

Hello Julian,

I have not so many tweaks installed, and none of them I suspect to be causing this. I use Activator 1.8.4 beta6, and the only actions in it are Bluepicker and LastApp. The issue persisted even after uninstalling LastApp, and as well as after reinstalling Activator completely.

I also have uninstalled FlipSwitch control center (or whatever the tweak name was) - I have replaced it with CCSettings, but it had no effect on this issue.

Next, I tried to assign different gestures to invoke BluePicker in Activator, but again - it behaves the same way regardless of chosen gesture.

If there is any way on how I can provide you more information, please let me know (maybe some debug version or so...)

Thanks in advance, Jan

    1. 2014 v 21:29, Julian Weiss notifications@github.com:

Unfortunately, I couldn't replicate this issue. Have you tried checking to see if it's another tweak conflicting? I don't have an iPad on-hand, so it could be isolated to your device model, but I would've hoped to receive another report of this bug (yours is the only one).

— Reply to this email directly or view it on GitHub.

insanj commented 9 years ago

Reproducible on all iPads, but on no other device types. Clearly has something to do with view hierarchy (particularly with UIWindows) on tablets. @bensge offered a great example of a dirty hack to resolve this in-process:

@interface _UIModalItemHostingWindow : UIWindow
@end

const char key;

@implementation _UIModalItemHostingWindow (KJUARR)
-(void)_kjuarr_makeWindowLevelPermanent
{
    objc_setAssociatedObject(self, &key, @YES, OBJC_ASSOCIATION_RETAIN);
}

-(void)setWindowLevel:(CGFloat)level
{
    if (objc_getAssociatedObject(self,&key) != nil && [objc_getAssociatedObject(self,&key) boolValue]){
        //Ignore call
    }
    else {
        [super setWindowLevel:level];
    }
}
@end

@implementation KJUARRAlertView
-(void)show
{
    [super show];
    _UIModalItemHostingWindow *w = (_UIModalItemHostingWindow *)[UIWindow keyWindow];
    if ([w isKindOfClass:objc_getClass("_UIModalItemHostingWindow")]){
        w.windowLevel = 2004; //1337 h4x0r
        [w _kjuarr_makeWindowLevelPermanent];
    }

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_kjuarr_willHide:) name:@"_KJUARR_KJUARRWillHide" object:nil];
}
mike4047 commented 9 years ago

Any update on this? Bluepicker works great on iPad Air 8.1.1 otherwise. Thanks.

asadia commented 9 years ago

Is there a simple way to implement the rudimentary fix mentioned above? Bluepicker is my main tweak for my iPad Mini 1 on 8.1.2 and it would be nice to be able to use it from inside any app as well as the lockscreen and homescreen. Thanks!