[macOS] Fix crash when setting window properties - #21357
Conversation
|
Hey there @MartyIX! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
cc @mattleibow because of his work on #16637. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
3ad3310 to
1ebaaa0
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
@mattleibow Could you please take a look? |
|
@rmarinho @mattleibow Feedback would be greatly appreaciated on this one. |
| } | ||
|
|
||
| #if MACCATALYST | ||
| bool _frameUpdateInProgress = false; |
There was a problem hiding this comment.
Is there a way to use the _batchFrameUpdate field? That is already being set when the frame is updating.
There was a problem hiding this comment.
I'll try if it works.
| if (_frameUpdateInProgress) { | ||
| X = frame.X; | ||
| Y = frame.Y; | ||
| Width = frame.Width; | ||
| Height = frame.Height; | ||
|
|
||
| return; | ||
| } |
There was a problem hiding this comment.
What is the difference between setting this and using SetValueCore?
There was a problem hiding this comment.
I can't recall specifically but I think it was that SetValueCore lead to a crash precisely because it leads to an infinite loop:
Does it make sense to you? I can try to dig into it again if that doesn't sound right but I don't have a solid grasp of SetValueCore so a little explanation of what it is supposed to would be very welcome.
There was a problem hiding this comment.
SetValueCore updates the property value, but you are also setting Height which should also update the property. If there is a loop, maybe there is a bug in the "unused" logic - or maybe something should not be updating...
There was a problem hiding this comment.
Hm, my VS Code on macOS got totally broken, I can't debug MAUI projects anymore.
Anyway, I think it's good to put a breakpoint on L217 to see the stacktrace there and if this PR makes sense or not.
I'll try to work on this PR later. I spent 2 hours and I couldn't get that stacktrace. I'm out of time for now.
Description of Change
I'm not really sure if the approach of the patch is correct. It's the only one I could make as I don't understand details here.
Feedback is welcome.
See #21306 (comment) for an explanation of the bug.
Issues Fixed
Fixes #21306