summaryrefslogtreecommitdiff
path: root/UICaboodle
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-02-19 16:16:44 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2011-02-19 17:01:07 -0800
commit8dbdaafa2948a9c2fb180a9571bf3bb0a669b934 (patch)
treeba9a5991cbcba7b1b8a6521b3416e5ca0ec3b2ea /UICaboodle
parent673a6e1ab4f3aab438db5281785b516c3c151e48 (diff)
Use setViewportWidth: only on main thread.
Diffstat (limited to 'UICaboodle')
-rw-r--r--UICaboodle/BrowserView.h2
-rw-r--r--UICaboodle/BrowserView.mm8
2 files changed, 10 insertions, 0 deletions
diff --git a/UICaboodle/BrowserView.h b/UICaboodle/BrowserView.h
index 4e9be45..51cb345 100644
--- a/UICaboodle/BrowserView.h
+++ b/UICaboodle/BrowserView.h
@@ -130,4 +130,6 @@
- (void) dispatchEvent:(NSString *)event;
+- (void) setViewportWidthOnMainThread:(float)value;
+
@end
diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm
index d549640..43f2905 100644
--- a/UICaboodle/BrowserView.mm
+++ b/UICaboodle/BrowserView.mm
@@ -646,6 +646,14 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
[self _setViewportWidth];
}
+- (void) _setViewportWidthOnMainThread:(NSNumber *)width {
+ [self setViewportWidth:[width floatValue]];
+}
+
+- (void) setViewportWidthOnMainThread:(float)width {
+ [self performSelectorOnMainThread:@selector(_setViewportWidthOnMainThread:) withObject:[NSNumber numberWithFloat:width] waitUntilDone:NO];
+}
+
- (void) webViewUpdateViewSettings:(UIWebView *)view {
[self _setViewportWidth];
}