update 7-Zip to 4.62
[sugaredwine.git] / patches / 0025-explorer-respect-the-dpi-setting-in-the-taskbar.patch
blobde5bfc8204b0359e813b1c16745a3cd40ed123ec
1 From 4116c7de41f570fd62d3d584889f31306a256fc9 Mon Sep 17 00:00:00 2001
2 From: Vincent Povirk <vincent@codeweavers.com>
3 Date: Thu, 16 Oct 2008 12:28:39 -0500
4 Subject: [PATCH] explorer: respect the dpi setting in the taskbar
6 ---
7 programs/explorer/taskbar.c | 8 ++++----
8 programs/explorer/tasklist.c | 2 +-
9 2 files changed, 5 insertions(+), 5 deletions(-)
11 diff --git a/programs/explorer/taskbar.c b/programs/explorer/taskbar.c
12 index 9dde2ca..040e774 100644
13 --- a/programs/explorer/taskbar.c
14 +++ b/programs/explorer/taskbar.c
15 @@ -40,17 +40,17 @@ static void taskbar_setpos(void)
16 HFONT font, oldFont;
17 HDC hdc;
19 + hdc = GetDC(startbutton);
21 /* calculate size of start button */
22 ZeroMemory(&lf, sizeof(lf));
23 ZeroMemory(&start_rc, sizeof(start_rc));
24 - lf.lfHeight = -12;
25 + lf.lfHeight = -MulDiv(9, GetDeviceCaps(hdc, LOGPIXELSY), 72);
26 lf.lfWeight = FW_NORMAL;
27 lf.lfPitchAndFamily = DEFAULT_PITCH|FF_SWISS;
28 strcpy(lf.lfFaceName, "Arial");
29 font = CreateFontIndirectA(&lf);
31 - hdc = GetDC(startbutton);
33 oldFont = SelectObject(hdc, font);
34 DrawTextA(hdc, "Start", -1, &start_rc, DT_SINGLELINE|DT_CALCRECT);
35 SelectObject(hdc, oldFont);
36 @@ -185,7 +185,7 @@ static LRESULT WINAPI taskbar_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
38 /* draw caption */
39 ZeroMemory(&lf, sizeof(lf));
40 - lf.lfHeight = -12;
41 + lf.lfHeight = -MulDiv(9, GetDeviceCaps(dis->hDC, LOGPIXELSY), 72);
42 lf.lfWeight = FW_NORMAL;
43 lf.lfPitchAndFamily = DEFAULT_PITCH|FF_SWISS;
44 strcpy(lf.lfFaceName, "Arial");
45 diff --git a/programs/explorer/tasklist.c b/programs/explorer/tasklist.c
46 index d6a9b5a..de46024 100644
47 --- a/programs/explorer/tasklist.c
48 +++ b/programs/explorer/tasklist.c
49 @@ -380,7 +380,7 @@ static LRESULT WINAPI tasklist_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
51 /* draw caption */
52 ZeroMemory(&lf, sizeof(lf));
53 - lf.lfHeight = -12;
54 + lf.lfHeight = -MulDiv(9, GetDeviceCaps(dis->hDC, LOGPIXELSY), 72);
55 lf.lfWeight = FW_NORMAL;
56 lf.lfPitchAndFamily = DEFAULT_PITCH|FF_SWISS;
57 strcpy(lf.lfFaceName, "Arial");
58 --
59 1.5.6.5