Flickering in Mac build but NOT in Win32?

This is the first time I’ve ever encountered this behavior, and am wondering if anyone has seen it. I’m working on a canvas-based control which displays a combination of paint-event-created objects (e.g., a background created with a call to fillRect, and an image on top of that), along with a group-2D drawn last in the paint event which the user can drag around the canvas. This Group2D object consists of a rectShape and eight ovalShapes which act as “handles” that the user can also drag to change the size of the rectangle.

It works very well at this point, EXCEPT that while it’s totally flicker-free during the dragging operations in the Windows build, it often flickers, sometimes horribly, in the Mac build.

In all my years of using RB, RS, and Xojo, this is the first time that I’ve had flickering problems in a Mac build (and almost the first time I’ve had none in a Windows build). I’ve tried it with Xojo 2014r2.1 and 2015r1 with the same results on Mac OS X 10.10.2 and Windows 7 running in a Parallels VM.

Could this be a Yosemite issue? I don’t have a Mavericks or earlier machine handy to test on…

I’ve seen this in Canvas, Listbox and OpenGLSurface and believe it’s a Yosemite issue. Using Refresh instead of Invalidate may help.

edit: I think it’s a Xojo interplay issue with Yosemite since I don’t see other apps flicker.

I believe I saw a Xojo engineer comment that it is a Yosemite issue.

If you can narrow this down to a small reproducible test case, I’d love to take a look. I’ve seen it occasionally in the IDE, but that’s a very complicated view hierarchy to try and debug (plus it doesn’t happen reliably).

Thanks to all three of you for the quick replies.

I tried that, but sadly, the flickering is unchanged…

I can as I’ve been working on developing this in a small project of its own. Should I file a Feedback report, or send it to you directly, Joe?

Feedback report please.

If it helps, I’ve taken video of the flicker and can see sometimes no drawing is done, other times some of it gets drawn and fails part way through the drawing code.

This is what a Canvas drawing should look like

This is a partial flicker, not all the dots got drawn, the dashes and border are missing.

Video: http://home.comcast.net/~trochoid/invalidateflicker1.mov (16.6MB) The top/left number counts paint passes.

Same happens in Listbox. Sometimes the whole thing is blank but there’s also frames like this where the Cell Background and Text Paint fail part way through (should be filled with rows)

The flickering occurs sporadically, seems to be more likely under heavy load or switching apps, but not always.

In an app I use daily with a Listbox it’s usually flicker free (I usually only use for short periods of time) but if it starts to flicker it’s like it gets locked into that behavior and flickers really bad. Resizing the Window (and hence LB) resets it and it’ll be flicker free again for a time.

Comcast? You poor soul.

[quote=178894:@Will Shank]The flickering occurs sporadically, seems to be more likely under heavy load or switching apps, but not always.

In an app I use daily with a Listbox it’s usually flicker free (I usually only use for short periods of time) but if it starts to flicker it’s like it gets locked into that behavior and flickers really bad. Resizing the Window (and hence LB) resets it and it’ll be flicker free again for a time.[/quote]

I’m seeing the same behavior. Sometimes, it doesn’t flicker at all for a little while, but once it starts, it seems to get worse over time. I’ve sent my test app to a colleague with a Mavericks machine, and will report his results when I get them

I now have confirmation that the flickering appears to be limited to Yosemite on the Mac version.

As to this:

I’ve had Comcast Business internet and voice for a few years now, and am quite happy with it. Service, support, and performance are very good, though the price could be lower :stuck_out_tongue:

I’ve seen this too, periodically with Xojo and also with some MWX apps and even some of Apple’s apps, the dock & the menubar! When the dock and/or menubar start flickering, it’s a good indication that the system will freeze soon! I use Apple’s Numbers a lot, and that crashes so easily on Yosemite.

Magic (my latest application) also had lots of weird visual glitches, most of these were solved when I enabled CALayers on the contentView of the Window. However this also incurred other visual glitches, like controls not showing up in the correct place and also the whole window not displaying correctly when it’s first opened. Controls can be fixed by forcing them to refresh and the window not displaying correctly can be fixed by making it 1 pixel taller and then back to it’s original size.

I’ve also read that the easiest solution is to disable “Vibrancy” in System Preferences, I’ve even heard of people saying that their whole machine feels faster with this disabled. I’ve even read of people resetting the PRAM and NVRAM can help.

The final two options I’ve read which might fix these graphics related issues, are to do a clean install of Yosemite 10.10.2 from the App Store and also to revert back to Mavericks.

I’m going to try a clean install of Yosemite on my development machine (which I keep clean to begin with) as I’m tired of having to restart it at least once every frigging day. PRAM & NVRAM reset didn’t help.

Don’t make me say it… Don’t make me… aaugh!! Ok, I’ll say it. “You should use a proper OS, like Windows.” :slight_smile:

Thanks, I needed a good laugh :smiley:

I came up with this stress test that, with time, will flicker under vigorous scrolling. I believe if your computer is more powerful than mine this won’t flicker, or very very infrequently (maybe requires a more intense drawing routine). In addition I need to be playing a youtube video. My reproducing environment…

2 year old MacBook something OS 10.10.2
Xojo 15r1 running in debug
Cocoa
Playing youtube in Theater mode
Vigorous scrolling

[code]Sub Open()
me.ColumnCount = 7
for i As integer = 0 to 2000
me.AddRow(Str(i), “a”, “b”, “c”, “d”, “e”, “f”)
next
End Sub

Function CellBackgroundPaint(g As Graphics, row As Integer, column As Integer) As Boolean

g.ForeColor = HSV(1.0, 0.5, 1-column/6)
g.FillRect 0, 0, g.Width, g.Height //Fill Background

dim xy() As integer = Array(0, 4,4, 30,6, 50,16, 4,16)

g.ForeColor = &c00FF0080
g.FillPolygon(xy) //Fill Green shape

g.ForeColor = &cffffff
g.PenWidth = 3
g.PenHeight = 3
g.DrawPolygon(xy) //Outline shape

End Function[/code]

Some frame grabs

You can see the point where it stops drawing. In the first picture, row 400 (the 3rd row down) while drawing column 6 it gets as far as filling the green shape but the white outline doesn’t make it to screen and column 7 is skipped entirely. In the second picture drawing is inneffective after filling the background of the 2nd row, 1st column. I believe the rows drawn after are either buffered by the LB or old contents, couldn’t tell from the video.

Turning off vibrancy it still flickers (never noticed the dock or anything else flicker though (jinxed now?))

In previous experiments I logged that when it flickers the drawing code is getting executed, it’s just not making it to screen, as if some graphics context has gone moot.

It should also be noted the Listbox or a Canvas never stops in an empty or partially drawn state, flickers only occur in the midst of rapid mouse events. And Carbon apps don’t flicker.

Ha ha ha…

With Yosemite, Apple really have lost the stability argument.

Well. I am working on an app that resizes controls dynamically. On Windows, it is impossible to have a backdrop picture on the window, so bad is the flicker. Some controls flicker more than others, though. Worst offenders are BevelButton and SegmentedControl. Rectangles, labels, and even canvases backdrop and ImageWell are fine.

On Mac under Yosemite 10.10.2, not quite smooth as silk, but very close to it. Backdrop picture on the window, resize of it as well, none of the offendes under Windows flickers. I did notice a slight flickers in canvases painted pictures, though.

Overall, Mac still is the champion in flicker reduction. Too bad sometimes it looses it’s footing now.

I’m not sure whether this is good or bad news :stuck_out_tongue:

So far, I’ve not seen it in anything other than Xojo. (Now that I think about it, I sometimes notice significant flickering in the Xojo IDE running under Yosemite when I just mouse around the tab area.) Adobe apps (InDesign, Illustrator, Acrobat) never flicker for me, no matter how complex a shape I move around. I’m just hoping that either Apple or Xojo will be able to solve it.

On a positive note, the Windows version of my test app is totally flicker-free. I’m pretty sure that wouldn’t have been possible in previous versions of RB/RS/Xojo…

A lot of the IDE is made with canvases which content is probably drawn in paint, the only case where I noticed a significant flicker in Yosemite. The workaround I found for my apps that do not need constant change in the picture is to add a backdrop picture and draw to its graphics instead of g. Strangely enough, it seems to flicker less.

Now is this really a Windows problem or a Xojo problem. If you build the same app with Visual Studio, would you have the same flicker?

I am not even suggesting Windows graphic handling is better than Mac. Historically Mac graphics are just gorgeous, but I think you are exposing a limitation of Xojo and not Windows. Maybe I’m wrong, but I have some simple Xojo apps that can flicker pretty badly if I move the controls too much on Windows, yet the same (or similar implementation) in VS is smooth.

Happy to see Apple hired a bunch of MS developers for a change. Who knows, may be now they’ll come up with some clever blue screen of death of their own.

[quote=179025:@LangueR]@Michel Bujardet On Windows, it is impossible to have a backdrop picture on the window, so bad is the flicker.
Now is this really a Windows problem or a Xojo problem. If you build the same app with Visual Studio, would you have the same flicker?

I am not even suggesting Windows graphic handling is better than Mac. Historically Mac graphics are just gorgeous, but I think you are exposing a limitation of Xojo and not Windows. Maybe I’m wrong, but I have some simple Xojo apps that can flicker pretty badly if I move the controls too much on Windows, yet the same (or similar implementation) in VS is smooth.[/quote]

When I write Windows in the context of this forum, it is implicitly Xojo. VS is using the .NET framework, while Xojo is using the older Win32 framework. .NET brings the much better double buffering, like Mac OS X, which is way less prone to flicker.

So your impression is right : .NET/VS apps are much less flickery.

I have been pushing for .NET implementation in Xojo, just as well as many others, so now the feature request is 11th in the top cases in Feedback. Please feel free to add your points to push it up. It is sorely needed IMHO.

I know Xojo has been looking into it, though. But with all they have to think about these days with 64 bit and iOS, I am not so sure it is much present in their mind.