Skip to content

Commit e314e12

Browse files
committed
Found places
Composite:handleDPIChange Composite:setSize,:sendResize layout() sendBoundsInPixels() Gridlayout.layout Image:win32_getHandle() - maybe all resources? (20%)
1 parent 0a68dea commit e314e12

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/DPIZoomChangeRegistry.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,23 @@ public static void applyChange(Widget widget, int newZoom, float scalingFactor)
4949
if (widget == null) {
5050
return;
5151
}
52+
extracted(widget, newZoom, scalingFactor);
53+
Event event = new Event();
54+
event.type = SWT.ZoomChanged;
55+
event.widget = widget;
56+
event.detail = newZoom;
57+
event.doit = true;
58+
widget.notifyListeners(SWT.ZoomChanged, event);
59+
}
60+
61+
private static void extracted(Widget widget, int newZoom, float scalingFactor) {
5262
for (Entry<Class<? extends Widget>, DPIZoomChangeHandler> entry : dpiZoomChangeHandlers.entrySet()) {
5363
Class<? extends Widget> clazz = entry.getKey();
5464
DPIZoomChangeHandler handler = entry.getValue();
5565
if (clazz.isInstance(widget)) {
5666
handler.handleDPIChange(widget, newZoom, scalingFactor);
5767
}
5868
}
59-
Event event = new Event();
60-
event.type = SWT.ZoomChanged;
61-
event.widget = widget;
62-
event.detail = newZoom;
63-
event.doit = true;
64-
widget.notifyListeners(SWT.ZoomChanged, event);
6569
}
6670

6771
public static void registerHandler(DPIZoomChangeHandler zoomChangeVisitor, Class<? extends Widget> clazzToRegisterFor) {

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,9 @@ void setBoundsInPixels (int x, int y, int width, int height, int flags, boolean
10631063
state &= ~(RESIZE_OCCURRED | MOVE_OCCURRED);
10641064
state |= RESIZE_DEFERRED | MOVE_DEFERRED;
10651065
}
1066+
if (x == this.x && this.y == y && this.width == width && this.height == height && this.flags == flags) {
1067+
return;
1068+
}
10661069
super.setBoundsInPixels (x, y, width, height, flags, defer);
10671070
if (!defer && (state & CANVAS) != 0) {
10681071
boolean wasMoved = (state & MOVE_OCCURRED) != 0;

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3193,6 +3193,11 @@ void setBoundsInPixels (int x, int y, int width, int height, int flags) {
31933193
}
31943194

31953195
void setBoundsInPixels (int x, int y, int width, int height, int flags, boolean defer) {
3196+
long lol = topHandle ();
3197+
if(x == this.x && this.y == y && this.width == width && this.height == height && this.flags == flags) {
3198+
// System.out.println("yo " + lol);
3199+
return;
3200+
}
31963201
if (findImageControl () != null) {
31973202
if (backgroundImage == null) flags |= OS.SWP_NOCOPYBITS;
31983203
} else {
@@ -3202,7 +3207,8 @@ void setBoundsInPixels (int x, int y, int width, int height, int flags, boolean
32023207
}
32033208
}
32043209
}
3205-
long topHandle = topHandle ();
3210+
long topHandle = lol;
3211+
// System.out.println(topHandle);
32063212
if (defer && parent != null) {
32073213
forceResize ();
32083214
if (parent.lpwp != null) {
@@ -3229,8 +3235,12 @@ void setBoundsInPixels (int x, int y, int width, int height, int flags, boolean
32293235
}
32303236
}
32313237
OS.SetWindowPos (topHandle, 0, x, y, width, height, flags);
3238+
this.x = x;
3239+
this.y = y;this.width = width; this.height = height; this.flags = flags;
32323240
}
32333241

3242+
int x, y, width, height, flags;
3243+
32343244
/**
32353245
* Sets the receiver's size and location in points to the rectangular
32363246
* area specified by the argument. The <code>x</code> and

0 commit comments

Comments
 (0)