Skip to content

Commit 6bda7b0

Browse files
committed
[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 #62 nd #131
1 parent bb0f8dd commit 6bda7b0

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. */
@@ -2665,93 +2665,55 @@ public boolean getTouchEnabled () {
26652665
return (value & (OS.NID_READY | OS.NID_MULTI_INPUT)) == (OS.NID_READY | OS.NID_MULTI_INPUT);
26662666
}
26672667

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

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

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

2688-
long hEditTheme () {
2689-
if (hEditTheme != 0) return hEditTheme;
2690-
final char[] themeName = "EDIT\0".toCharArray();
2691-
return hEditTheme = OS.OpenThemeData (hwndMessage, themeName);
2684+
long hEditTheme (int dpi) {
2685+
return getOrCreateThemeData(dpi).hEditTheme();
26922686
}
26932687

2694-
long hExplorerBarTheme () {
2695-
if (hExplorerBarTheme != 0) return hExplorerBarTheme;
2696-
final char[] themeName = "EXPLORERBAR\0".toCharArray();
2697-
return hExplorerBarTheme = OS.OpenThemeData (hwndMessage, themeName);
2688+
long hExplorerBarTheme (int dpi) {
2689+
return getOrCreateThemeData(dpi).hExplorerBarTheme();
26982690
}
26992691

2700-
long hScrollBarTheme () {
2701-
if (hScrollBarTheme != 0) return hScrollBarTheme;
2702-
final char[] themeName = "SCROLLBAR\0".toCharArray();
2703-
return hScrollBarTheme = OS.OpenThemeData (hwndMessage, themeName);
2692+
long hScrollBarTheme (int dpi) {
2693+
return getOrCreateThemeData(dpi).hScrollBarTheme();
27042694
}
27052695

2706-
long hScrollBarThemeDark () {
2707-
if (hScrollBarThemeDark != 0) return hScrollBarThemeDark;
2708-
final char[] themeName = "Darkmode_Explorer::SCROLLBAR\0".toCharArray();
2709-
return hScrollBarThemeDark = OS.OpenThemeData (hwndMessage, themeName);
2696+
long hScrollBarThemeDark (int dpi) {
2697+
return getOrCreateThemeData(dpi).hScrollBarThemeDark();
27102698
}
27112699

2712-
long hScrollBarThemeAuto () {
2700+
long hScrollBarThemeAuto (int dpi) {
27132701
if (useDarkModeExplorerTheme) {
2714-
return hScrollBarThemeDark ();
2702+
return hScrollBarThemeDark (dpi);
27152703
} else {
2716-
return hScrollBarTheme ();
2704+
return hScrollBarTheme (dpi);
27172705
}
27182706
}
27192707

2720-
long hTabTheme () {
2721-
if (hTabTheme != 0) return hTabTheme;
2722-
final char[] themeName = "TAB\0".toCharArray();
2723-
return hTabTheme = OS.OpenThemeData (hwndMessage, themeName);
2708+
long hTabTheme (int dpi) {
2709+
return getOrCreateThemeData(dpi).hTabTheme();
27242710
}
27252711

27262712
void resetThemes() {
2727-
if (hButtonTheme != 0) {
2728-
OS.CloseThemeData (hButtonTheme);
2729-
hButtonTheme = 0;
2730-
}
2731-
if (hButtonThemeDark != 0) {
2732-
OS.CloseThemeData (hButtonThemeDark);
2733-
hButtonThemeDark = 0;
2734-
}
2735-
if (hEditTheme != 0) {
2736-
OS.CloseThemeData (hEditTheme);
2737-
hEditTheme = 0;
2738-
}
2739-
if (hExplorerBarTheme != 0) {
2740-
OS.CloseThemeData (hExplorerBarTheme);
2741-
hExplorerBarTheme = 0;
2742-
}
2743-
if (hScrollBarTheme != 0) {
2744-
OS.CloseThemeData (hScrollBarTheme);
2745-
hScrollBarTheme = 0;
2746-
}
2747-
if (hScrollBarThemeDark != 0) {
2748-
OS.CloseThemeData (hScrollBarThemeDark);
2749-
hScrollBarThemeDark = 0;
2750-
}
2751-
if (hTabTheme != 0) {
2752-
OS.CloseThemeData (hTabTheme);
2753-
hTabTheme = 0;
2713+
for (ThemeData themeData : themeDataMap.values()) {
2714+
themeData.reset();
27542715
}
2716+
themeDataMap.clear();
27552717
}
27562718

27572719
/**
@@ -5313,6 +5275,108 @@ static boolean isActivateShellOnForceFocus() {
53135275
return "true".equals(System.getProperty("org.eclipse.swt.internal.activateShellOnForceFocus", "true")); //$NON-NLS-1$
53145276
}
53155277

5278+
private ThemeData getOrCreateThemeData(int dpi) {
5279+
if (themeDataMap.containsKey(dpi)) {
5280+
return themeDataMap.get(dpi);
5281+
}
5282+
ThemeData themeData = new ThemeData(dpi);
5283+
themeDataMap.put(dpi, themeData);
5284+
return themeData;
5285+
}
5286+
5287+
private class ThemeData {
5288+
private long hButtonTheme;
5289+
private long hButtonThemeDark;
5290+
private long hEditTheme;
5291+
private long hExplorerBarTheme;
5292+
private long hScrollBarTheme;
5293+
private long hScrollBarThemeDark;
5294+
private long hTabTheme;
5295+
5296+
private int dpi;
5297+
5298+
private ThemeData(int dpi) {
5299+
this.dpi = dpi;
5300+
}
5301+
5302+
long hButtonTheme () {
5303+
if (hButtonTheme != 0) return hButtonTheme;
5304+
final char[] themeName = "BUTTON\0".toCharArray();
5305+
return hButtonTheme = openThemeData(themeName);
5306+
}
5307+
5308+
long hButtonThemeDark () {
5309+
if (hButtonThemeDark != 0) return hButtonThemeDark;
5310+
final char[] themeName = "Darkmode_Explorer::BUTTON\0".toCharArray();
5311+
return hButtonThemeDark = openThemeData(themeName);
5312+
}
5313+
5314+
long hEditTheme () {
5315+
if (hEditTheme != 0) return hEditTheme;
5316+
final char[] themeName = "EDIT\0".toCharArray();
5317+
return hEditTheme = openThemeData(themeName);
5318+
}
5319+
5320+
long hExplorerBarTheme () {
5321+
if (hExplorerBarTheme != 0) return hExplorerBarTheme;
5322+
final char[] themeName = "EXPLORERBAR\0".toCharArray();
5323+
return hExplorerBarTheme = openThemeData(themeName);
5324+
}
5325+
5326+
long hScrollBarTheme () {
5327+
if (hScrollBarTheme != 0) return hScrollBarTheme;
5328+
final char[] themeName = "SCROLLBAR\0".toCharArray();
5329+
return hScrollBarTheme = openThemeData(themeName);
5330+
}
5331+
5332+
long hScrollBarThemeDark () {
5333+
if (hScrollBarThemeDark != 0) return hScrollBarThemeDark;
5334+
final char[] themeName = "Darkmode_Explorer::SCROLLBAR\0".toCharArray();
5335+
return hScrollBarThemeDark = openThemeData(themeName);
5336+
}
5337+
5338+
long hTabTheme () {
5339+
if (hTabTheme != 0) return hTabTheme;
5340+
final char[] themeName = "TAB\0".toCharArray();
5341+
return hTabTheme = openThemeData(themeName);
5342+
}
5343+
5344+
5345+
public void reset() {
5346+
if (hButtonTheme != 0) {
5347+
OS.CloseThemeData (hButtonTheme);
5348+
hButtonTheme = 0;
5349+
}
5350+
if (hButtonThemeDark != 0) {
5351+
OS.CloseThemeData (hButtonThemeDark);
5352+
hButtonThemeDark = 0;
5353+
}
5354+
if (hEditTheme != 0) {
5355+
OS.CloseThemeData (hEditTheme);
5356+
hEditTheme = 0;
5357+
}
5358+
if (hExplorerBarTheme != 0) {
5359+
OS.CloseThemeData (hExplorerBarTheme);
5360+
hExplorerBarTheme = 0;
5361+
}
5362+
if (hScrollBarTheme != 0) {
5363+
OS.CloseThemeData (hScrollBarTheme);
5364+
hScrollBarTheme = 0;
5365+
}
5366+
if (hScrollBarThemeDark != 0) {
5367+
OS.CloseThemeData (hScrollBarThemeDark);
5368+
hScrollBarThemeDark = 0;
5369+
}
5370+
if (hTabTheme != 0) {
5371+
OS.CloseThemeData (hTabTheme);
5372+
hTabTheme = 0;
5373+
}
5374+
}
5375+
5376+
private long openThemeData(final char[] themeName) {
5377+
return OS.OpenThemeData(hwndMessage, themeName, dpi);
5378+
}
5379+
}
53165380
/**
53175381
* {@return whether rescaling of shells at runtime when the DPI scaling of a
53185382
* 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
@@ -2350,7 +2350,7 @@ LRESULT wmPrint (long hwnd, long wParam, long lParam) {
23502350
rect.left = rect.top = 0;
23512351
int border = getSystemMetrics (OS.SM_CXEDGE);
23522352
OS.ExcludeClipRect (wParam, border, border, rect.right - border, rect.bottom - border);
2353-
OS.DrawThemeBackground (display.hEditTheme (), wParam, OS.EP_EDITTEXT, OS.ETS_NORMAL, rect, null);
2353+
OS.DrawThemeBackground (display.hEditTheme (getZoom()), wParam, OS.EP_EDITTEXT, OS.ETS_NORMAL, rect, null);
23542354
return new LRESULT (code);
23552355
}
23562356
}

0 commit comments

Comments
 (0)