Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
7d7eee09
Commit
7d7eee09
authored
May 15, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecfg: Constrain DPI values to the commonly supported ones.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4ece6abd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
winecfg.h
programs/winecfg/winecfg.h
+2
-0
x11drvdlg.c
programs/winecfg/x11drvdlg.c
+16
-5
No files found.
programs/winecfg/winecfg.h
View file @
7d7eee09
...
...
@@ -38,6 +38,8 @@
#define IS_OPTION_FALSE(ch) \
((ch) == 'n' || (ch) == 'N' || (ch) == 'f' || (ch) == 'F' || (ch) == '0')
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
extern
WCHAR
*
current_app
;
/* NULL means editing global settings */
/* Use get_reg_key and set_reg_key to alter registry settings. The changes made through
...
...
programs/winecfg/x11drvdlg.c
View file @
7d7eee09
...
...
@@ -53,6 +53,7 @@ static const WCHAR explorerW[] = {'E','x','p','l','o','r','e','r',0};
static
const
WCHAR
explorer_desktopsW
[]
=
{
'E'
,
'x'
,
'p'
,
'l'
,
'o'
,
'r'
,
'e'
,
'r'
,
'\\'
,
'D'
,
'e'
,
's'
,
'k'
,
't'
,
'o'
,
'p'
,
's'
,
0
};
static
const
UINT
dpi_values
[]
=
{
96
,
120
,
144
,
168
,
192
,
216
,
240
,
288
,
336
,
384
,
432
,
480
};
static
BOOL
updating_ui
;
...
...
@@ -258,6 +259,15 @@ static void init_dpi_editbox(HWND hDlg)
updating_ui
=
FALSE
;
}
static
int
get_trackbar_pos
(
UINT
dpi
)
{
UINT
i
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
dpi_values
)
-
1
;
i
++
)
if
((
dpi_values
[
i
]
+
dpi_values
[
i
+
1
])
/
2
>=
dpi
)
break
;
return
i
;
}
static
void
init_trackbar
(
HWND
hDlg
)
{
HWND
hTrackBar
=
GetDlgItem
(
hDlg
,
IDC_RES_TRACKBAR
);
...
...
@@ -267,8 +277,9 @@ static void init_trackbar(HWND hDlg)
dwLogpixels
=
read_logpixels_reg
();
SendMessageW
(
hTrackBar
,
TBM_SETRANGE
,
TRUE
,
MAKELONG
(
MINDPI
,
MAXDPI
));
SendMessageW
(
hTrackBar
,
TBM_SETPOS
,
TRUE
,
dwLogpixels
);
SendMessageW
(
hTrackBar
,
TBM_SETRANGE
,
TRUE
,
MAKELONG
(
0
,
ARRAY_SIZE
(
dpi_values
)
-
1
));
SendMessageW
(
hTrackBar
,
TBM_SETPAGESIZE
,
0
,
1
);
SendMessageW
(
hTrackBar
,
TBM_SETPOS
,
TRUE
,
get_trackbar_pos
(
dwLogpixels
));
updating_ui
=
FALSE
;
}
...
...
@@ -297,7 +308,7 @@ static void update_dpi_trackbar_from_edit(HWND hDlg, BOOL fix)
if
(
dpi
>=
MINDPI
&&
dpi
<=
MAXDPI
)
{
SendDlgItemMessageW
(
hDlg
,
IDC_RES_TRACKBAR
,
TBM_SETPOS
,
TRUE
,
dpi
);
SendDlgItemMessageW
(
hDlg
,
IDC_RES_TRACKBAR
,
TBM_SETPOS
,
TRUE
,
get_trackbar_pos
(
dpi
)
);
set_reg_key_dwordW
(
HKEY_CURRENT_USER
,
logpixels_reg
,
logpixels
,
dpi
);
}
...
...
@@ -416,9 +427,9 @@ GraphDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch
(
wParam
)
{
default:
{
int
i
=
SendMessageW
(
GetDlgItem
(
hDlg
,
IDC_RES_TRACKBAR
),
TBM_GETPOS
,
0
,
0
);
SetDlgItemInt
(
hDlg
,
IDC_RES_DPIEDIT
,
i
,
TRUE
);
SetDlgItemInt
(
hDlg
,
IDC_RES_DPIEDIT
,
dpi_values
[
i
]
,
TRUE
);
update_font_preview
(
hDlg
);
set_reg_key_dwordW
(
HKEY_CURRENT_USER
,
logpixels_reg
,
logpixels
,
i
);
set_reg_key_dwordW
(
HKEY_CURRENT_USER
,
logpixels_reg
,
logpixels
,
dpi_values
[
i
]
);
break
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment