Skip to content

Just trigger SizeChanged when Window size changes#22413

Merged
PureWeen merged 13 commits into
dotnet:mainfrom
pictos:pj/window-size-fix
May 22, 2024
Merged

Just trigger SizeChanged when Window size changes#22413
PureWeen merged 13 commits into
dotnet:mainfrom
pictos:pj/window-size-fix

Conversation

@pictos
Copy link
Copy Markdown
Contributor

@pictos pictos commented May 15, 2024

Description of Change

Issues Fixed

Fixes #17991
Fixes #21306

@pictos pictos requested a review from a team as a code owner May 15, 2024 01:12
@pictos pictos requested review from jfversluis and mattleibow May 15, 2024 01:12
@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label May 15, 2024
@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

Comment thread src/Controls/src/Core/Window/Window.cs Outdated
@pictos pictos force-pushed the pj/window-size-fix branch from 8e57d91 to fd5ea38 Compare May 16, 2024 20:57
Comment thread src/Controls/src/Core/Element/Element.cs Outdated
Comment thread src/Controls/src/Core/Window/Window.cs Outdated
Comment thread src/Controls/src/Core/Window/Window.cs Outdated
Co-authored-by: Shane Neuville <shane94@hotmail.com>
@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

Comment thread src/Controls/src/Core/Window/Window.cs Outdated

int _batchFrameUpdate = 0;

bool disableHandlerUpdate;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chatted with @mattleibow about this one a bit, and I think my suggestions are somewhat just digging us into a deeper hole here :-)

I think we've been trying to fix this issue the wrong way for some time now and need to revert this entire method back to what it originally looked like here

https://github.com/dotnet/maui/pull/4942/files#diff-07d5a2c0b5069d448623e88d890e41bc2c21e12f99bd01f1349903a332d4130cR202-R222

And then change this method

private protected override void UpdateHandlerValue(string property)
		{
			if (disableHandlerUpdate)
				return;

			base.UpdateHandlerValue(property);
		}

to

private protected override void UpdateHandlerValue(string property)
		{
			if (_batchFrameUpdate > 0)
				return;

			base.UpdateHandlerValue(property);
		}

@PureWeen
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen self-requested a review May 17, 2024 20:51
@pictos
Copy link
Copy Markdown
Contributor Author

pictos commented May 19, 2024

Looks like the error are unrelated with my changes, from logs I could see something about Cake

@MartyIX
Copy link
Copy Markdown
Contributor

MartyIX commented May 20, 2024

I wonder if this PR fixes #21306 as well. My PR #21357 touches src/Controls/src/Core/Window/Window.cs as this PR.

I don't have my macOS machine with me now to test it but to verify if the bug is fixed or not, one can:

  1. Run src/Controls/samples/Controls.Sample project
  2. In the app, navigate to Core -> Multi-Window and click Set window size to 700x500 and
  3. the application crashes.

@PureWeen PureWeen merged commit 7948366 into dotnet:main May 22, 2024
@pictos pictos deleted the pj/window-size-fix branch May 22, 2024 04:16
@mattleibow
Copy link
Copy Markdown
Member

@MartyIX it did not it seems. I added a comment to the issue with a tiny bit more detail, but yeah, we need to fix this sooner rather than later.

@MartyIX
Copy link
Copy Markdown
Contributor

MartyIX commented May 22, 2024

@MartyIX it did not it seems. I added a comment to the issue with a tiny bit more detail, but yeah, we need to fix this sooner rather than later.

Yes, I added some debug info in #21306 (comment). So I think it's clear what happens. Not so much clear how to fix it (at least to me).

@malsabi
Copy link
Copy Markdown

malsabi commented Jun 13, 2024

In SR6 .NET 8 CollectionView SizeChanged is not executing after this fix I guess. It was working fine on SR5. Is there a way to detect when the CollectionView size is changed ?

@mattleibow
Copy link
Copy Markdown
Member

@malsabi could you file a regression issue? Then we can go this ASAP.

@malsabi
Copy link
Copy Markdown

malsabi commented Jun 13, 2024

@mattleibow Here you go #23029

@mattleibow
Copy link
Copy Markdown
Member

Thanks, I will have a look.

@github-actions github-actions Bot locked and limited conversation to collaborators Jul 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[macOS] Crash in multi-window mode in the Controls.sample project Window.SizeChanged fired moving MainWindow

7 participants