Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window Resize Spam #101

Closed
lansdon-qualta opened this issue Dec 10, 2019 · 12 comments
Closed

Window Resize Spam #101

lansdon-qualta opened this issue Dec 10, 2019 · 12 comments

Comments

@lansdon-qualta
Copy link

In version 3.6.1+ we are getting infinite window resize event spam. Nested elements are constantly firing window resize events. This is after trying to resize the main window. Not sure the source but when we revert to 3.6.0 the problem seems to not be present.

@Dirkster99
Copy link
Owner

Dirkster99 commented Dec 10, 2019

There are only 4 commits in version 3.6.1 - would you be able to find mention the commit that makes the difference for your with regard to the infinite spam loop together with a test layout and a way to actually verify the spam?

The list of relevant commits is shown towards the bottom of the Readme.md file.

You can use any of the available test applications in the project - just modify it for the test case such that the problem becomes more obvious, thanks Dirk

@lansdon-qualta
Copy link
Author

If I had to guess I would say this commit looks suspicious and directly related to making nested elements run resize-like events:
[https://github.com/Dirkster99/AvalonDock/commit/8f20e135df660b823494061f4ff63b78cdcdd008#diff-f04b9af42e4129457a18f32d34d43f57]

@Dirkster99
Copy link
Owner

Yes, I looked at it and was just about to write the same (you've beaten me by 20 seconds) - its funny that the issue item updates while you type if someone else is faster :-) - I am not completely sure about a fix right now but maybe just caching the last value and comparing it with the new value and only calling the RaiseChildrenTreeChanged() when the size differ is already the fix to remove the spam(?).

@scdmitryvodich Do you see a better fix to optimize this problem?

@scdmitryvodich
Copy link
Contributor

This commit solved the #81 issue. I'll investigate if a better solution can be found.

@scdmitryvodich
Copy link
Contributor

@lansdon-qualta I have a couple of questions concerning this issue:

  1. Which event is exactly fired (ChildrenTreeChanged or some else)?
  2. Do you get some infinite loop of events or are there just a lot of them?
  3. Would it be possible to provide a description of steps to reproduce the exact issue you are facing?

@lansdon-qualta
Copy link
Author

Our environment is a bit complicated but I'll see if this helps.

  1. The event that is causing us issues is actually a symptom of this. It's a SizeChanged event coming from a nested VisualData3DViewPort or DxViewportView (AB4D.com).
  2. It's hard to tell the exact frequency but in the log it appears to be happening ~2x / second. It happens non stop after we resize the MainWindow of the application. It's frequent enough to lock up the UI completely to the point where we can't interact with UI at all. (granted, some of that could be the subsequent code called by the event subscribers.
  3. Steps (in our environment)
    a. Resize the application/main window to be not maximized.
    b. Maximize the application/main window
    c. SizeChanged events are propagated repeatedly by the 3dViewPort

Like I said, if we revert to 3.6.0 it doesn't happen, if we upgrade to 3.6.1 or 3.6.2 it starts happening making the application unusable.

@scdmitryvodich
Copy link
Contributor

@lansdon-qualta Thank you! I'll try to investigate it.

scdmitryvodich added a commit to scdmitryvodich/AvalonDock that referenced this issue Dec 17, 2019
@scdmitryvodich
Copy link
Contributor

@lansdon-qualta Could you please have a look if changes in #103 solve your issue?

@scdmitryvodich
Copy link
Contributor

@lansdon-qualta @Dirkster99 Could you please have a look if changes in #103 may solve this issue?

@lansdon-qualta
Copy link
Author

It looks like it fixed the problem I was having. Using the new .dll I lost mouse click events in my nested viewport, but looking at your code change, it doesn't seem related? Not sure. The spam stopped though.

@scdmitryvodich
Copy link
Contributor

Mouse click events should not be affected by this change.

Dirkster99 added a commit that referenced this issue Jan 21, 2020
Fix #101 and new fix for #81 with docked pane becomes not visible.
@Dirkster99
Copy link
Owner

I merged the change as it does seem to address the issue without introducing new problems (as far as I can see). This change is currently available in the master branch and should also be available in the next release NuGet version.

Thanks for your great work and feedbacks @scdmitryvodich and @lansdon-qualta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants