From: Jay Freeman (saurik) Date: Thu, 24 Mar 2011 16:44:57 +0000 (-0700) Subject: Correctly handle layout updates of background tabs. X-Git-Tag: v1.1.0%rc1~9 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/3cf380678a801294f8fae45b4594682dce224165 Correctly handle layout updates of background tabs. --- diff --git a/CyteKit/WebView.mm b/CyteKit/WebView.mm index a71e5c27..09c9c408 100644 --- a/CyteKit/WebView.mm +++ b/CyteKit/WebView.mm @@ -369,6 +369,14 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se else return nil; } +- (void) setNeedsLayout { + [super setNeedsLayout]; + + WebFrame *frame([[[self _documentView] webView] mainFrame]); + if ([frame respondsToSelector:@selector(setNeedsLayout)]) + [frame setNeedsLayout]; +} + @end static void $UIWebViewWebViewDelegate$_clearUIWebView(UIWebViewWebViewDelegate *self, SEL sel) { diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm index 36c8177d..4d4d250e 100644 --- a/CyteKit/WebViewController.mm +++ b/CyteKit/WebViewController.mm @@ -1060,6 +1060,9 @@ float CYScrollViewDecelerationRateNormal; if ([self hidesNavigationBar]) [self _setHidesNavigationBar:YES animated:animated]; + // XXX: why isn't this evern called automatically? + [[self webView] setNeedsLayout]; + [self dispatchEvent:@"CydiaViewWillAppear"]; [super viewWillAppear:animated]; } diff --git a/iPhonePrivate.h b/iPhonePrivate.h index fc85776d..98f86b4e 100644 --- a/iPhonePrivate.h +++ b/iPhonePrivate.h @@ -6,6 +6,7 @@ #include // }}} // #import <*> {{{ +#import #import // }}} // typedef enum {*} *; {{{ @@ -341,6 +342,10 @@ typedef enum { @end // }}} // @interface Web* (*) {{{ +@interface WebFrame (Apple) +- (void) setNeedsLayout; +@end + @interface WebPreferences (Apple) + (void) _setInitialDefaultTextEncodingToSystemEncoding; - (void) _setLayoutInterval:(NSInteger)interval;