Skip to content

Commit 008a04c

Browse files
committed
Revert ImageBasedFrame zoom change listener
This commit reverts the change to the zoom changed listener of the ImageBasedFrame. The async DPI change handling of the windows implementation does not need the complex event chaining anymore.
1 parent 27438b5 commit 008a04c

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

bundles/org.eclipse.e4.ui.widgets/src/org/eclipse/e4/ui/widgets/ImageBasedFrame.java

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
******************************************************************************/
1515
package org.eclipse.e4.ui.widgets;
1616

17-
import java.util.concurrent.atomic.AtomicReference;
18-
1917
import org.eclipse.swt.SWT;
2018
import org.eclipse.swt.events.ControlEvent;
2119
import org.eclipse.swt.events.ControlListener;
@@ -26,8 +24,6 @@
2624
import org.eclipse.swt.widgets.Canvas;
2725
import org.eclipse.swt.widgets.Composite;
2826
import org.eclipse.swt.widgets.Control;
29-
import org.eclipse.swt.widgets.Listener;
30-
import org.eclipse.swt.widgets.Shell;
3127
import org.eclipse.swt.widgets.ToolBar;
3228

3329

@@ -70,20 +66,12 @@ public ImageBasedFrame(Composite parent, Control toWrap, boolean vertical,
7066
ImageBasedFrame frame = (ImageBasedFrame) event.widget;
7167
frame.setCursor(null);
7268
});
73-
7469
toWrap.addListener(SWT.ZoomChanged, event -> {
75-
Shell shell = parent.getShell();
76-
final AtomicReference<Listener> scaleOnParentResize = new AtomicReference<>();
77-
scaleOnParentResize.set(e -> {
78-
if (isDisposed()) {
79-
return;
80-
}
81-
toWrap.pack(true);
82-
setFramedControlLocation();
83-
parent.layout();
84-
shell.removeListener(SWT.Resize, scaleOnParentResize.get());
85-
});
86-
shell.addListener(SWT.Resize, scaleOnParentResize.get());
70+
if (isDisposed()) {
71+
return;
72+
}
73+
toWrap.pack(true);
74+
setFramedControlLocation();
8775
});
8876

8977
addMouseMoveListener(e -> {

0 commit comments

Comments
 (0)