Skip to content

Commit 5dd0c28

Browse files
akoch-yattafedejeanne
authored andcommitted
[win32] Use DPI dependent OS API calls
This commit replaces the OS calls for OpenThemeData with calls to the dpi dependent equivalent OpenThemeDataForDpi. Therefor the handling of loading/unloading of theme in Display is refactored to be able to manage multiple DPI dependent variants of a theme in multi zoom environments Contributes to eclipse-platform#62 nd eclipse-platform#131
1 parent 552167f commit 5dd0c28

File tree

12 files changed

+219
-79
lines changed

12 files changed

+219
-79
lines changed

bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4581,4 +4581,12 @@ public static int HRESULT_FROM_WIN32(int x) {
45814581
public static final native boolean DuplicateHandle(long hSourceProcessHandle, long hSourceHandle, long hTargetProcessHandle,
45824582
long [] lpTargetHandle, int dwDesiredAccess, boolean b, int dwOptions);
45834583

4584+
4585+
public static long OpenThemeData(long hwnd, char[] themeName, int dpi) {
4586+
if (OS.WIN32_BUILD >= OS.WIN32_BUILD_WIN10_1809) {
4587+
return OS.OpenThemeDataForDpi(hwnd, themeName, dpi);
4588+
} else {
4589+
return OS.OpenThemeData(hwnd, themeName);
4590+
}
4591+
}
45844592
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ private int getCheckboxTextOffset(long hdc) {
13111311
SIZE size = new SIZE();
13121312

13131313
if (OS.IsAppThemed ()) {
1314-
OS.GetThemePartSize(display.hButtonTheme(), hdc, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, null, OS.TS_TRUE, size);
1314+
OS.GetThemePartSize(display.hButtonTheme(getZoom()), hdc, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, null, OS.TS_TRUE, size);
13151315
result += size.cx;
13161316
} else {
13171317
result += DPIUtil.scaleUp(13, nativeZoom);
@@ -1543,7 +1543,7 @@ LRESULT wmDrawChild (long wParam, long lParam) {
15431543
boolean pressed = ((struct.itemState & OS.ODS_SELECTED) != 0);
15441544
boolean enabled = getEnabled ();
15451545
int iStateId = getThemeStateId(style, pressed, enabled);
1546-
OS.DrawThemeBackground (display.hScrollBarThemeAuto (), struct.hDC, OS.SBP_ARROWBTN, iStateId, rect, null);
1546+
OS.DrawThemeBackground (display.hScrollBarThemeAuto (getZoom()), struct.hDC, OS.SBP_ARROWBTN, iStateId, rect, null);
15471547
} else {
15481548
int uState = OS.DFCS_SCROLLLEFT;
15491549
switch (style & (SWT.UP | SWT.DOWN | SWT.LEFT | SWT.RIGHT)) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1856,7 +1856,7 @@ LRESULT wmNCPaint (long hwnd, long wParam, long lParam) {
18561856
rect.left = rect.top = 0;
18571857
int border = getSystemMetrics (OS.SM_CXEDGE);
18581858
OS.ExcludeClipRect (hDC, border, border, rect.right - border, rect.bottom - border);
1859-
OS.DrawThemeBackground (display.hEditTheme (), hDC, OS.EP_EDITTEXT, OS.ETS_NORMAL, rect, null);
1859+
OS.DrawThemeBackground (display.hEditTheme (getZoom()), hDC, OS.EP_EDITTEXT, OS.ETS_NORMAL, rect, null);
18601860
OS.ReleaseDC (hwnd, hDC);
18611861
return new LRESULT (code);
18621862
}

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

Lines changed: 126 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public class Display extends Device implements Executor {
153153
}
154154

155155
/* XP Themes */
156-
long hButtonTheme, hButtonThemeDark, hEditTheme, hExplorerBarTheme, hScrollBarTheme, hScrollBarThemeDark, hTabTheme;
156+
private Map<Integer, ThemeData> themeDataMap = new HashMap<>();
157157
static final char [] EXPLORER = new char [] {'E', 'X', 'P', 'L', 'O', 'R', 'E', 'R', 0};
158158
static final char [] TREEVIEW = new char [] {'T', 'R', 'E', 'E', 'V', 'I', 'E', 'W', 0};
159159
/* Emergency switch to be used in case of regressions. Not supposed to be changed when app is running. */
@@ -2667,93 +2667,55 @@ public boolean getTouchEnabled () {
26672667
return (value & (OS.NID_READY | OS.NID_MULTI_INPUT)) == (OS.NID_READY | OS.NID_MULTI_INPUT);
26682668
}
26692669

2670-
long hButtonTheme () {
2671-
if (hButtonTheme != 0) return hButtonTheme;
2672-
final char[] themeName = "BUTTON\0".toCharArray();
2673-
return hButtonTheme = OS.OpenThemeData (hwndMessage, themeName);
2670+
long hButtonTheme (int dpi) {
2671+
return getOrCreateThemeData(dpi).hButtonTheme();
26742672
}
26752673

2676-
long hButtonThemeDark () {
2677-
if (hButtonThemeDark != 0) return hButtonThemeDark;
2678-
final char[] themeName = "Darkmode_Explorer::BUTTON\0".toCharArray();
2679-
return hButtonThemeDark = OS.OpenThemeData (hwndMessage, themeName);
2674+
long hButtonThemeDark (int dpi) {
2675+
return getOrCreateThemeData(dpi).hButtonThemeDark();
26802676
}
26812677

2682-
long hButtonThemeAuto () {
2678+
long hButtonThemeAuto (int dpi) {
26832679
if (useDarkModeExplorerTheme) {
2684-
return hButtonThemeDark ();
2680+
return hButtonThemeDark (dpi);
26852681
} else {
2686-
return hButtonTheme ();
2682+
return hButtonTheme (dpi);
26872683
}
26882684
}
26892685

2690-
long hEditTheme () {
2691-
if (hEditTheme != 0) return hEditTheme;
2692-
final char[] themeName = "EDIT\0".toCharArray();
2693-
return hEditTheme = OS.OpenThemeData (hwndMessage, themeName);
2686+
long hEditTheme (int dpi) {
2687+
return getOrCreateThemeData(dpi).hEditTheme();
26942688
}
26952689

2696-
long hExplorerBarTheme () {
2697-
if (hExplorerBarTheme != 0) return hExplorerBarTheme;
2698-
final char[] themeName = "EXPLORERBAR\0".toCharArray();
2699-
return hExplorerBarTheme = OS.OpenThemeData (hwndMessage, themeName);
2690+
long hExplorerBarTheme (int dpi) {
2691+
return getOrCreateThemeData(dpi).hExplorerBarTheme();
27002692
}
27012693

2702-
long hScrollBarTheme () {
2703-
if (hScrollBarTheme != 0) return hScrollBarTheme;
2704-
final char[] themeName = "SCROLLBAR\0".toCharArray();
2705-
return hScrollBarTheme = OS.OpenThemeData (hwndMessage, themeName);
2694+
long hScrollBarTheme (int dpi) {
2695+
return getOrCreateThemeData(dpi).hScrollBarTheme();
27062696
}
27072697

2708-
long hScrollBarThemeDark () {
2709-
if (hScrollBarThemeDark != 0) return hScrollBarThemeDark;
2710-
final char[] themeName = "Darkmode_Explorer::SCROLLBAR\0".toCharArray();
2711-
return hScrollBarThemeDark = OS.OpenThemeData (hwndMessage, themeName);
2698+
long hScrollBarThemeDark (int dpi) {
2699+
return getOrCreateThemeData(dpi).hScrollBarThemeDark();
27122700
}
27132701

2714-
long hScrollBarThemeAuto () {
2702+
long hScrollBarThemeAuto (int dpi) {
27152703
if (useDarkModeExplorerTheme) {
2716-
return hScrollBarThemeDark ();
2704+
return hScrollBarThemeDark (dpi);
27172705
} else {
2718-
return hScrollBarTheme ();
2706+
return hScrollBarTheme (dpi);
27192707
}
27202708
}
27212709

2722-
long hTabTheme () {
2723-
if (hTabTheme != 0) return hTabTheme;
2724-
final char[] themeName = "TAB\0".toCharArray();
2725-
return hTabTheme = OS.OpenThemeData (hwndMessage, themeName);
2710+
long hTabTheme (int dpi) {
2711+
return getOrCreateThemeData(dpi).hTabTheme();
27262712
}
27272713

27282714
void resetThemes() {
2729-
if (hButtonTheme != 0) {
2730-
OS.CloseThemeData (hButtonTheme);
2731-
hButtonTheme = 0;
2732-
}
2733-
if (hButtonThemeDark != 0) {
2734-
OS.CloseThemeData (hButtonThemeDark);
2735-
hButtonThemeDark = 0;
2736-
}
2737-
if (hEditTheme != 0) {
2738-
OS.CloseThemeData (hEditTheme);
2739-
hEditTheme = 0;
2740-
}
2741-
if (hExplorerBarTheme != 0) {
2742-
OS.CloseThemeData (hExplorerBarTheme);
2743-
hExplorerBarTheme = 0;
2744-
}
2745-
if (hScrollBarTheme != 0) {
2746-
OS.CloseThemeData (hScrollBarTheme);
2747-
hScrollBarTheme = 0;
2748-
}
2749-
if (hScrollBarThemeDark != 0) {
2750-
OS.CloseThemeData (hScrollBarThemeDark);
2751-
hScrollBarThemeDark = 0;
2752-
}
2753-
if (hTabTheme != 0) {
2754-
OS.CloseThemeData (hTabTheme);
2755-
hTabTheme = 0;
2715+
for (ThemeData themeData : themeDataMap.values()) {
2716+
themeData.reset();
27562717
}
2718+
themeDataMap.clear();
27572719
}
27582720

27592721
/**
@@ -5315,6 +5277,108 @@ static boolean isActivateShellOnForceFocus() {
53155277
return "true".equals(System.getProperty("org.eclipse.swt.internal.activateShellOnForceFocus", "true")); //$NON-NLS-1$
53165278
}
53175279

5280+
private ThemeData getOrCreateThemeData(int dpi) {
5281+
if (themeDataMap.containsKey(dpi)) {
5282+
return themeDataMap.get(dpi);
5283+
}
5284+
ThemeData themeData = new ThemeData(dpi);
5285+
themeDataMap.put(dpi, themeData);
5286+
return themeData;
5287+
}
5288+
5289+
private class ThemeData {
5290+
private long hButtonTheme;
5291+
private long hButtonThemeDark;
5292+
private long hEditTheme;
5293+
private long hExplorerBarTheme;
5294+
private long hScrollBarTheme;
5295+
private long hScrollBarThemeDark;
5296+
private long hTabTheme;
5297+
5298+
private int dpi;
5299+
5300+
private ThemeData(int dpi) {
5301+
this.dpi = dpi;
5302+
}
5303+
5304+
long hButtonTheme () {
5305+
if (hButtonTheme != 0) return hButtonTheme;
5306+
final char[] themeName = "BUTTON\0".toCharArray();
5307+
return hButtonTheme = openThemeData(themeName);
5308+
}
5309+
5310+
long hButtonThemeDark () {
5311+
if (hButtonThemeDark != 0) return hButtonThemeDark;
5312+
final char[] themeName = "Darkmode_Explorer::BUTTON\0".toCharArray();
5313+
return hButtonThemeDark = openThemeData(themeName);
5314+
}
5315+
5316+
long hEditTheme () {
5317+
if (hEditTheme != 0) return hEditTheme;
5318+
final char[] themeName = "EDIT\0".toCharArray();
5319+
return hEditTheme = openThemeData(themeName);
5320+
}
5321+
5322+
long hExplorerBarTheme () {
5323+
if (hExplorerBarTheme != 0) return hExplorerBarTheme;
5324+
final char[] themeName = "EXPLORERBAR\0".toCharArray();
5325+
return hExplorerBarTheme = openThemeData(themeName);
5326+
}
5327+
5328+
long hScrollBarTheme () {
5329+
if (hScrollBarTheme != 0) return hScrollBarTheme;
5330+
final char[] themeName = "SCROLLBAR\0".toCharArray();
5331+
return hScrollBarTheme = openThemeData(themeName);
5332+
}
5333+
5334+
long hScrollBarThemeDark () {
5335+
if (hScrollBarThemeDark != 0) return hScrollBarThemeDark;
5336+
final char[] themeName = "Darkmode_Explorer::SCROLLBAR\0".toCharArray();
5337+
return hScrollBarThemeDark = openThemeData(themeName);
5338+
}
5339+
5340+
long hTabTheme () {
5341+
if (hTabTheme != 0) return hTabTheme;
5342+
final char[] themeName = "TAB\0".toCharArray();
5343+
return hTabTheme = openThemeData(themeName);
5344+
}
5345+
5346+
5347+
public void reset() {
5348+
if (hButtonTheme != 0) {
5349+
OS.CloseThemeData (hButtonTheme);
5350+
hButtonTheme = 0;
5351+
}
5352+
if (hButtonThemeDark != 0) {
5353+
OS.CloseThemeData (hButtonThemeDark);
5354+
hButtonThemeDark = 0;
5355+
}
5356+
if (hEditTheme != 0) {
5357+
OS.CloseThemeData (hEditTheme);
5358+
hEditTheme = 0;
5359+
}
5360+
if (hExplorerBarTheme != 0) {
5361+
OS.CloseThemeData (hExplorerBarTheme);
5362+
hExplorerBarTheme = 0;
5363+
}
5364+
if (hScrollBarTheme != 0) {
5365+
OS.CloseThemeData (hScrollBarTheme);
5366+
hScrollBarTheme = 0;
5367+
}
5368+
if (hScrollBarThemeDark != 0) {
5369+
OS.CloseThemeData (hScrollBarThemeDark);
5370+
hScrollBarThemeDark = 0;
5371+
}
5372+
if (hTabTheme != 0) {
5373+
OS.CloseThemeData (hTabTheme);
5374+
hTabTheme = 0;
5375+
}
5376+
}
5377+
5378+
private long openThemeData(final char[] themeName) {
5379+
return OS.OpenThemeData(hwndMessage, themeName, dpi);
5380+
}
5381+
}
53185382
/**
53195383
* {@return whether rescaling of shells at runtime when the DPI scaling of a
53205384
* shell's monitor changes is activated for this device}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static int checkStyle (int style) {
137137
long hDC = OS.GetDC (handle);
138138
long hTheme = 0;
139139
if (isAppThemed ()) {
140-
hTheme = display.hExplorerBarTheme ();
140+
hTheme = display.hExplorerBarTheme (getZoom());
141141
}
142142
long hCurrentFont = 0, oldFont = 0;
143143
if (hTheme == 0) {
@@ -247,13 +247,13 @@ void drawThemeBackground (long hDC, long hwnd, RECT rect) {
247247
RECT rect2 = new RECT ();
248248
OS.GetClientRect (handle, rect2);
249249
OS.MapWindowPoints (handle, hwnd, rect2, 2);
250-
OS.DrawThemeBackground (display.hExplorerBarTheme (), hDC, OS.EBP_NORMALGROUPBACKGROUND, 0, rect2, null);
250+
OS.DrawThemeBackground (display.hExplorerBarTheme (getZoom()), hDC, OS.EBP_NORMALGROUPBACKGROUND, 0, rect2, null);
251251
}
252252

253253
void drawWidget (GC gc, RECT clipRect) {
254254
long hTheme = 0;
255255
if (isAppThemed ()) {
256-
hTheme = display.hExplorerBarTheme ();
256+
hTheme = display.hExplorerBarTheme (getZoom());
257257
}
258258
if (hTheme != 0) {
259259
RECT rect = new RECT ();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ void drawThemeBackground (long hDC, long hwnd, RECT rect) {
298298
OS.GetClientRect (handle, rect2);
299299
OS.MapWindowPoints (handle, hwnd, rect2, 2);
300300
if (OS.IntersectRect (new RECT (), rect2, rect)) {
301-
OS.DrawThemeBackground (display.hTabTheme (), hDC, OS.TABP_BODY, 0, rect2, null);
301+
OS.DrawThemeBackground (display.hTabTheme (getZoom()), hDC, OS.TABP_BODY, 0, rect2, null);
302302
}
303303
}
304304

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3566,7 +3566,7 @@ void sendEraseItemEvent (TableItem item, NMLVCUSTOMDRAW nmcd, long lParam, Event
35663566
rect.right += EXPLORER_EXTRA;
35673567
pClipRect.right += EXPLORER_EXTRA;
35683568
}
3569-
long hTheme = OS.OpenThemeData (handle, Display.TREEVIEW);
3569+
long hTheme = OS.OpenThemeData (handle, Display.TREEVIEW, getZoom());
35703570
int iStateId = selected ? OS.LISS_SELECTED : OS.LISS_HOT;
35713571
if (OS.GetFocus () != handle && selected && !drawHot) iStateId = OS.LISS_SELECTEDNOTFOCUS;
35723572
if (drawDrophilited) iStateId = OS.LISS_SELECTED;
@@ -4263,14 +4263,14 @@ void setCheckboxImageList (int width, int height, boolean fixScroll) {
42634263
* artifacts, limit the rectangle to actual checkbox bitmap size.
42644264
*/
42654265
SIZE size = new SIZE();
4266-
OS.GetThemePartSize(display.hButtonTheme(), memDC, OS.BP_CHECKBOX, 0, null, OS.TS_TRUE, size);
4266+
OS.GetThemePartSize(display.hButtonTheme(getZoom()), memDC, OS.BP_CHECKBOX, 0, null, OS.TS_TRUE, size);
42674267
itemWidth = Math.min (size.cx, itemWidth);
42684268
itemHeight = Math.min (size.cy, itemHeight);
42694269
}
42704270
int left = (width - itemWidth) / 2, top = (height - itemHeight) / 2;
42714271
OS.SetRect (rect, left, top, left + itemWidth, top + itemHeight);
42724272
if (OS.IsAppThemed ()) {
4273-
long hTheme = display.hButtonTheme ();
4273+
long hTheme = display.hButtonTheme(getZoom());
42744274
OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, rect, null);
42754275
rect.left += width; rect.right += width;
42764276
OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_CHECKEDNORMAL, rect, null);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2751,7 +2751,7 @@ LRESULT WM_DRAWITEM (long wParam, long lParam) {
27512751
drawBackground (struct.hDC, rect, -1, pt.x, pt.y);
27522752
if (struct.CtlID == SWT.ICON_CANCEL && struct.hwndItem == hwndActiveIcon && OS.IsAppThemed()) {
27532753
int state = OS.GetKeyState (OS.VK_LBUTTON) < 0 ? OS.PBS_PRESSED : OS.PBS_HOT;
2754-
OS.DrawThemeBackground (display.hButtonThemeAuto (), struct.hDC, OS.BP_PUSHBUTTON, state, rect, null);
2754+
OS.DrawThemeBackground (display.hButtonThemeAuto (getZoom()), struct.hDC, OS.BP_PUSHBUTTON, state, rect, null);
27552755
}
27562756
int width = rect.right - rect.left;
27572757
int height = rect.bottom - rect.top;

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ LRESULT CDDS_ITEMPOSTPAINT (NMTVCUSTOMDRAW nmcd, long wParam, long lParam) {
497497
}
498498
}
499499
draw = false;
500-
long hTheme = OS.OpenThemeData (handle, Display.TREEVIEW);
500+
long hTheme = OS.OpenThemeData (handle, Display.TREEVIEW, getZoom());
501501
int iStateId = selected ? OS.TREIS_SELECTED : OS.TREIS_HOT;
502502
if (OS.GetFocus () != handle && selected && !hot) iStateId = OS.TREIS_SELECTEDNOTFOCUS;
503503
OS.DrawThemeBackground (hTheme, hDC, OS.TVP_TREEITEM, iStateId, pRect, pClipRect);
@@ -710,7 +710,7 @@ LRESULT CDDS_ITEMPOSTPAINT (NMTVCUSTOMDRAW nmcd, long wParam, long lParam) {
710710
backgroundRect = selectionRect;
711711
}
712712
}
713-
long hTheme = OS.OpenThemeData (handle, Display.TREEVIEW);
713+
long hTheme = OS.OpenThemeData(handle, Display.TREEVIEW, getZoom());
714714
int iStateId = selected ? OS.TREIS_SELECTED : OS.TREIS_HOT;
715715
if (OS.GetFocus () != handle && selected && !hot) iStateId = OS.TREIS_SELECTEDNOTFOCUS;
716716
OS.DrawThemeBackground (hTheme, hDC, OS.TVP_TREEITEM, iStateId, pRect, backgroundRect);
@@ -1140,7 +1140,7 @@ LRESULT CDDS_ITEMPREPAINT (NMTVCUSTOMDRAW nmcd, long wParam, long lParam) {
11401140
}
11411141
pRect.left -= EXPLORER_EXTRA;
11421142
pClipRect.left -= EXPLORER_EXTRA;
1143-
long hTheme = OS.OpenThemeData (handle, Display.TREEVIEW);
1143+
long hTheme = OS.OpenThemeData (handle, Display.TREEVIEW, getZoom());
11441144
int iStateId = selected ? OS.TREIS_SELECTED : OS.TREIS_HOT;
11451145
if (OS.GetFocus () != handle && selected && !hot) iStateId = OS.TREIS_SELECTEDNOTFOCUS;
11461146
OS.DrawThemeBackground (hTheme, hDC, OS.TVP_TREEITEM, iStateId, pRect, pClipRect);
@@ -4781,14 +4781,14 @@ void setCheckboxImageList () {
47814781
* artifacts, limit the rectangle to actual checkbox bitmap size.
47824782
*/
47834783
SIZE size = new SIZE();
4784-
OS.GetThemePartSize(display.hButtonTheme(), memDC, OS.BP_CHECKBOX, 0, null, OS.TS_TRUE, size);
4784+
OS.GetThemePartSize(display.hButtonTheme(getZoom()), memDC, OS.BP_CHECKBOX, 0, null, OS.TS_TRUE, size);
47854785
itemWidth = Math.min (size.cx, itemWidth);
47864786
itemHeight = Math.min (size.cy, itemHeight);
47874787
}
47884788
int left = (width - itemWidth) / 2, top = (height - itemHeight) / 2 + 1;
47894789
OS.SetRect (rect, left + width, top, left + width + itemWidth, top + itemHeight);
47904790
if (OS.IsAppThemed ()) {
4791-
long hTheme = display.hButtonTheme ();
4791+
long hTheme = display.hButtonTheme(getZoom());
47924792
OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_UNCHECKEDNORMAL, rect, null);
47934793
rect.left += width; rect.right += width;
47944794
OS.DrawThemeBackground (hTheme, memDC, OS.BP_CHECKBOX, OS.CBS_CHECKEDNORMAL, rect, null);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2349,7 +2349,7 @@ LRESULT wmPrint (long hwnd, long wParam, long lParam) {
23492349
rect.left = rect.top = 0;
23502350
int border = getSystemMetrics (OS.SM_CXEDGE);
23512351
OS.ExcludeClipRect (wParam, border, border, rect.right - border, rect.bottom - border);
2352-
OS.DrawThemeBackground (display.hEditTheme (), wParam, OS.EP_EDITTEXT, OS.ETS_NORMAL, rect, null);
2352+
OS.DrawThemeBackground (display.hEditTheme (getZoom()), wParam, OS.EP_EDITTEXT, OS.ETS_NORMAL, rect, null);
23532353
return new LRESULT (code);
23542354
}
23552355
}

0 commit comments

Comments
 (0)