Skip to content

Commit 0131733

Browse files
committed
Logging for registerHandler amidst applyChange #62
This commit adds logging for if there happens a modification to DPIZoomChangeRegistry::dpiZoomChangeHandlers during the DPIZoomChangeRegistry::applyChange operation while looping through handlers for DPIZoomChangeHandler::handleDPIChange calls. The reason of modification can be that some classes are loaded later and they call to register their DPIZoomChangeHandler in the DPIZoomChangeRegistry::dpiZoomChangeHandlers. contributes to #62 and #127
1 parent 8c2e85c commit 0131733

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,17 @@ public static void applyChange(Widget widget, int newZoom, float scalingFactor)
4949
if (widget == null) {
5050
return;
5151
}
52+
int initialHandlerCount = dpiZoomChangeHandlers.entrySet().size();
5253
for (Entry<Class<? extends Widget>, DPIZoomChangeHandler> entry : dpiZoomChangeHandlers.entrySet()) {
5354
Class<? extends Widget> clazz = entry.getKey();
5455
DPIZoomChangeHandler handler = entry.getValue();
5556
if (clazz.isInstance(widget)) {
5657
handler.handleDPIChange(widget, newZoom, scalingFactor);
5758
}
5859
}
60+
if(initialHandlerCount != dpiZoomChangeHandlers.entrySet().size()) {
61+
System.out.println("dpiZoomChangeHandler registration occured amidst processing a DPI Change event");
62+
}
5963
Event event = new Event();
6064
event.type = SWT.ZoomChanged;
6165
event.widget = widget;

0 commit comments

Comments
 (0)