OK, so here's the issue I'm facing.
I have a window with a WKWebView in it. When the window is resized, the webview is to be resized.
The thing is when I'm trying to increase the window's size (or - far more noticeable - when maximizing the window) there is a flicker, with a white background, until the webview redraws itself.
Now, the weird thing is: when I'm using a WebView (yes, the supposedly "legacy" one), this works flawlessly.
What's going on? Is there any way to work with a WKWebView on MacOS without this flicker?
Related
I use SkiaSharp canvas to draw the main game screen, and then there are various Xamarin.Forms Buttons around the UI. This all works fine on when used directly on iPhone or iPad using a finger. However, when I connect a mouse (e.g., through a MacBook or otherwise), the buttons start working with about 10% chance after mouse-clicking on the SkiaSharp canvas (and not receiving the mouse click events with 90% chance). The SkiaSharp canvas itself works just fine.
If I bring up the iOS app launch menu from the bottom (which probably somehow temporarily exists the mouse navigation on the app), the buttons start working again with the mouse. But if I click the SkiaSharp canvas again with the mouse, the buttons have a high chance of becoming disabled again. If I change to using a finger, all works fine (even if the mouse clicks were not being registered immediately before). However, mouse clicks are not being registered even after touching with a finger, so finger-touching does not reset the issue with the mouse (but bringing up the menu from the bottom does).
We found this bug by testing the iOS game on MacBook Pro (the iOS apps recently came available on the App Store) but the same issue persists also directly with an iPad / mouse combination. It seems to be some sort of an issue between using a mouse (on iPad or on MacBook Pro), SkiaSharp canvas and Xamarin.Forms buttons.
Does anyone know what the root cause of the problem is and what is the workaround?
Not an answer as such, but some more information about reproducing the issue: A simpler repro case may be this small project: https://github.com/jrc14/TraceMatching/ .
Don't worry too much about what it's doing, but note that you're mean to click in the grey Skia canvas in the middle to create 'targets' - and that after you've done that, mouse-clicks are getting lost.
If you run it on a Mac, you'll see that, though the clicks get lost after you've clicked on the Skia canvas, they will start being received again if you click on something else (another app, or the Mac background).
(further edit) - after some noodling around I did find a workaround. If, once you've finished processing the touch action on the SKCanvasView, you reset its EnableTouchEvents property (i.e. set it to false, then back to true again), it seems that the clicks don't get lost any more,
Due to performance issues I've change our wall scrolling to use native scrolling (overflow-scroll) instead of js scrolling. (The infinite scroll is working)
The performance is somewhat better but here is the weird thing:
In android, when I scroll down, it just doesn't scroll down after some scrolling (scroll back up is working). When I do something like opening and closing the statusbar of the physical/simulator phone, then it is working again.
I guess it something related to the element refresh of the android WebView, any idea?
My project is on base SDK 10.6 built in Xcode 3 - it’s important that it is a universal binary that also works with PPC.
In 10.9 my application has really jerky scrolling compared to Safari - if I add
[self setWantsLayer:YES]; the scrolling is super fast like Safari, great!
However I get visual glitches when scrolling, see screenshot of eBay where the legal image which was supposed to be fixed at the bottom of the page keeps repeating.
I know setWantsLayer isn’t supposed to be used with a webKit, but is there anyway to stop these visual glitches or is there another way to get the smooth scrolling without using setWantsLayer.
Above is an issue with eBay when scrolling and below is an issue with Twitter while scrolling, happens on various websites especially with fixed objects.
Issue with Twitter
Actually I originally thought the below solution was a solution without realising that I was back to the horrible jumpy scrolling. I leave it for reference.
I had the same problem you seems to have here.
I found that if I implemented the canDrawSubviewsIntoLayer in the subclass my glitches with the rendering were fixed.
so in the initWithCoder/initWithFrame method call:
[self setWantsLayer:YES];
then implement canDrawSubviewsIntoLayer
- (BOOL)canDrawSubviewsIntoLayer {
return YES;
}
You need to subclass the webView. I also found that works equally well if instead you subclass the NSView below and do the same in the NSView subclass but since I don't understand why that works my suggestion is to subclass the webView.
I hope it helps you and helps others.
In a project I have been working on I wanted to use CoreAnimation layers to improve tableview rendering, however when i turned on Core Animation for certain layers it caused issues with my WebView.
https://github.com/jozefdransfield/TestWebView demonstrates a WebView inside a view displaying a large image. Which reproduces the issue I am seeing.
If View has Core Animation Layer checked then the WebView does not draw the image properly if you scroll within the webView, with it uncheck the webView behaves as expected.
Has anyone seen this issue before and have an idea how to fix/work around it. Or can you simply not mix webviews with CALayers?
Occasionally when I scroll horizontally in an app using the magic mouse, the current tab or page I'm scrolling on freezes and thereon in that app, scrolling is completely non-functional.
For example, if I'm using Safari and I scroll horizontally to go back to the previous link, the current tab freezes, stuck in the middle of the animation. If I close the frozen tab, the other tabs work fine, but I can't scroll vertically or horizontally in them. I have to scroll using the scrollbar. No other apps are affected and if I restart the affected application, everything goes back to normal and the mouse scrolling is functional again.
Has anybody else had this issue? Any ideas on how to fix this?
I was running Lion when this issue started. I updated to Mavericks hoping it would be fixed, but no luck. I'm currently running Mavericks GM on an iMac (latest model).
This is an issue after installing Mavericks. Go to System Preferences/General and click on Show scroll bars: Check "Always". Hope this helps.