Fix for Flickering in Embedded Apps #1588
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contributes to fixing the flicker issue in SashLayout whenever an embedded app is present inside it. The fix disallows the setredraw on controls if they contain any embedded application as their descendant. There's an issue open https://bugs.eclipse.org/bugs/show_bug.cgi?id=558392 for a long time for the resizing of the sashlayout. The current way of performing layout on mouse move works fine for eclipse widgets by calling setRedraw to false which freezes the state of UI and performing a re-layout and then setting redraw to true leading to a smooth transition of the Sashlayout when its borders are dragged by mouse but it is not the same for external Embedded applications.
The embedded applications, e.g. webview 2, excel, etc, use a different renderer because of which whenever setRedraw is set to false, the whole portion where it was drawn goes blank white and when its set back, the apps are visible again, leading to a flicker effect.
One possible solution is to never allow this setredraw to be set back and forth when there's a child with embedded application present and visible. This PR implements the same approach disallowing setRedraw to be enforcedin this case. Even if it is not called from SashLayout, if a client sets it to false, it will lead to the disappearance of the application from the display, which is not desirable. So, the approach is to only allow it when the embedded applications are either not visible or not present.
The solution is not perfect but it definitely feels better as compared to the flickering effect. It definitely brings back a shaky effect on the min/max button as mentioned in the bug above while resizing but only when embedded apps are visible. However, this effect is also visible in these scenarios by default: #1122 (comment) and also when you resize the shell.
contributes to #1122