@@ -55,6 +55,8 @@ public abstract class Control extends Widget implements Drawable {
5555 DPIZoomChangeRegistry .registerHandler (Control ::handleDPIChange , Control .class );
5656 }
5757
58+ private static Set <Control > embeddedControls = new HashSet <>();
59+
5860 /**
5961 * the handle to the OS resource
6062 * (Warning: This field is platform dependent)
@@ -711,6 +713,9 @@ void createWidget () {
711713 if ((state & PARENT_BACKGROUND ) != 0 ) {
712714 setBackground ();
713715 }
716+ if ((style & SWT .EMBEDDED ) != 0 ) {
717+ embeddedControls .add (this );
718+ }
714719}
715720
716721int defaultBackground () {
@@ -2494,6 +2499,9 @@ void releaseParent () {
24942499@ Override
24952500void releaseWidget () {
24962501 super .releaseWidget ();
2502+ if ((style & SWT .EMBEDDED ) != 0 ) {
2503+ embeddedControls .remove (this );
2504+ }
24972505 if (toolTipText != null ) {
24982506 setToolTipText (getShell (), null );
24992507 }
@@ -3606,6 +3614,25 @@ boolean setRadioSelection (boolean value) {
36063614 return false ;
36073615}
36083616
3617+ private boolean hasEmbeddedChildren () {
3618+ for (Control ec : embeddedControls ) {
3619+ if (!ec .isDisposed () && ec .isVisible ()) {
3620+ if (ec .isChildOf (this )) return true ;
3621+ }
3622+ }
3623+ return false ;
3624+ }
3625+
3626+ private boolean isChildOf (Control parent ) {
3627+ Control c = this ;
3628+ while (c != null ) {
3629+ if (c == parent ) return true ;
3630+
3631+ c = c .getParent ();
3632+ }
3633+ return false ;
3634+ }
3635+
36093636/**
36103637 * If the argument is <code>false</code>, causes subsequent drawing
36113638 * operations in the receiver to be ignored. No drawing of any kind
@@ -3631,6 +3658,20 @@ boolean setRadioSelection (boolean value) {
36313658 */
36323659public void setRedraw (boolean redraw ) {
36333660 checkWidget ();
3661+
3662+ /*
3663+ * Some embedded applications like webview2 (Edge), Excel, etc
3664+ * have a renderer that will draw the whole application white
3665+ * when setting redraw to false and will repaint it completely
3666+ * when setting it to true. This causes flickering, which is why
3667+ * turning redraw on/off is disabled in these cases.
3668+ *
3669+ * https://github.com/eclipse-platform/eclipse.platform.swt/issues/1122
3670+ */
3671+ if (hasEmbeddedChildren ()) {
3672+ return ;
3673+ }
3674+
36343675 /*
36353676 * Feature in Windows. When WM_SETREDRAW is used to turn
36363677 * off drawing in a widget, it clears the WS_VISIBLE bits
0 commit comments