corrupted window rendering on drag resize

Xojo2017r3 OSX El Capitan

Drag resizing the width of the window of my current project results in flashes of corrupted rendering at what seems to be specific width intervals. Dragging only the height doesn’t cause the problem.

Anyone else experience this? Searched feedback and could not find an exact match.

Screen recording uploaded here:

Nope, haven’t seen this. 32bit or 64bit? What happens when you draw something into the canvases?

Happens in both 32 and 64 bit compiles. Drawing to the canvases doesn’t change the behaviour. I tried removing controls to see if one control or the other is causing it. Haven’t tried every combination but so far it hasn’t gone away.

I thought maybe it would have to do with a dropout in redrawing. So I tried adding self.Invalidate in the Resizing event. This didn’t change anything. I tried self.UpdateNow in the Resizing event instead. Also no change.

Then I started wondering if maybe this is happening for the opposite reason - not because the window isn’t being redrawn enough, but because the window is being redrawn too often.

I put DelayMBS 0.1 in the Resizing event. And guess what, the problem goes away. Of course resizing response is slowed down, but the corrupted drawing is gone.

I have many apps that do the exact type of thing with no flashing at all (flicker is a Windows trait :slight_smile: )
What kind of controls are the black boxes? Are there any groupboxes or panelpages in use?

I saw a bit of strangeness in resizing/redrawing on MacOS when I was testing one of the new GraffitiSuite classes. It almost seemed like the ScaleFactor was being lost in the process, but this applied to only one specific class.

Dave, the black boxes are canvas controls.

Since redrawing the window less often during resizing solves the problem, I wonder if this might only crop up with certain processor speeds / graphics hardware configs, so only faster machines would be affected, and slower machines wouldn’t show the issue.

That said, I’m running a 2015 MacBook Pro 3.1 GHz i7 with Intel Iris 6100 Graphics chipset.

are you issuing a REFRESH command during RESIZE events?
if so, change it to INVALIDATE and see what happens

[quote=371846:@Dave S]are you issuing a REFRESH command during RESIZE events?
if so, change it to INVALIDATE and see what happens[/quote]

No. See above.

You said resizing event, try using canvas.invalidate in the resized event instead

really the only thing that might need to be “invalidated” in the canvas… the other controls should be able to “fend for themselves”

#1. Restart your machine.

It sounds like your graphics drivers are drunk and misbehaving. If that doesn’t change it…

#2. Do a clean install of El Capitan.

This is not meant to come across as sounding bigheaded, but it does, basically I can resize windows with far more complicated controls and layouts without causing a problem, however for a while last year I was getting weird glitches and a lot of crashes when exceeding the physical amount of RAM in the machine. Once I did a clean install of the macOS (We still use El Cap for development) these problems went away. Our production machines are kept clean, so I can only assume that Apple’s installers have gotten lazy or incompetent and don’t do such a good job when updating.

In fact with the colossal amount of people who had problems updating to High Sierra, it strengthened my theory that the new internet powered installers are crap at upgrading. I’ve filed several bug reports over Apple’s internet based installers and how crap they are. In fact I’ve gotten a response that they’ve made improvements and if I find any issues I should report them.

[quote=371849:@Dave S]

really the only thing that might need to be “invalidated” in the canvas… the other controls should be able to “fend for themselves”[/quote]
These auto invalidate on dimension changes.

This is the only reason why I won’t buy a 2015 machine now, because of the gimped chipsets. That said, the only reason you should be getting issues like this is because either the drivers are borked or the chips are on their way out.

[quote=371932:@Sam Rowlands]#1. Restart your machine.

It sounds like your graphics drivers are drunk and misbehaving. If that doesn’t change it…

#2. Do a clean install of El Capitan.[/quote]

I appreciate your experience and expertise here, but given that this problem appears nowhere else except in my Xojo project, I have a hard time concluding that bad chips or OS installations are to blame. At least in my case, the problem is definitely specific to this project compiled in Xojo, and no other window in any other application shows the problem, so it seems obvious that something is going on in the way Xojo is implementing window drawing. I have noticed some very bad programming by Apple in some of their apps, like Apple Mail which refreshes controls and lists sometimes ungodly thousands of times in a row for no reason. The OS behaves this way too in some cases, drawing is taking place too often, refreshing too often. So on the other hand it seems like it could be OS related as stupid lazy programming by Apple. But then I would expect to see the same corrupted graphics happening in other apps, and I don’t see that. I just see a lot of lazy redundant redrawing.

Anyway I’ve found a workaround that gets rid of the problem, so I’m happy enough with that for now. Thanks everyone for the input.

Glad you got it sorted Aaron, the method of solving it is a bit of a concern though. It would be interesting to test your project with the problem still in there on another mac, maybe you could submit it as a private ticket in feedback so Xojo can take a look?

As long as you are the only one to have this problem I’d say it’s something on your computer. This is why I asked about an example to play with. Or you do something really odd ™.

Just bear in mind that many of us have far more complicated interfaces and don’t exhibit this problem, there is still a fair amount of developers still using macOS 10.11.6, so you might find this pops up for other windows also.

I would suggest that you try it on a different machine without your fix to see if you get that problem on that machine.[quote=372012:@Aaron Hunt]But then I would expect to see the same corrupted graphics happening in other apps, and I don’t see that. I just see a lot of lazy redundant redrawing.[/quote]
There’s many different variables which can affect how the contents of a Window are drawn.

There have been reports of a flickering issue issue where you could have weird behavior if you had two Xojo apps running on a mac with different user accounts (e.g. if you have Fast User Switching enabled).

Here’s the discussion: https://forum.xojo.com/43151-2017-r2-1-flickering/p2#p350662