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
7aa7d949
Commit
7aa7d949
authored
Mar 28, 2001
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for application-specific configuration for a few options
(Desktop, Managed, ScreenDepth and Synchronous).
parent
63200de9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
16 deletions
+42
-16
x11drv_main.c
dlls/x11drv/x11drv_main.c
+42
-16
No files found.
dlls/x11drv/x11drv_main.c
View file @
7aa7d949
...
...
@@ -130,15 +130,28 @@ static void get_server_startup(void)
/***********************************************************************
* get_config_key
*
* Get a config key from either the app-specific or the default config
*/
inline
static
DWORD
get_config_key
(
HKEY
defkey
,
HKEY
appkey
,
const
char
*
name
,
char
*
buffer
,
DWORD
size
)
{
if
(
appkey
&&
!
RegQueryValueExA
(
appkey
,
name
,
0
,
NULL
,
buffer
,
&
size
))
return
0
;
return
RegQueryValueExA
(
defkey
,
name
,
0
,
NULL
,
buffer
,
&
size
);
}
/***********************************************************************
* setup_options
*
* Setup the x11drv options.
*/
static
void
setup_options
(
void
)
{
char
buffer
[
25
6
];
HKEY
hkey
;
DWORD
type
,
count
;
char
buffer
[
MAX_PATH
+
1
6
];
HKEY
hkey
,
appkey
=
0
;
DWORD
count
;
if
(
RegCreateKeyExA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Wine
\\
Config
\\
x11drv"
,
0
,
NULL
,
REG_OPTION_VOLATILE
,
KEY_ALL_ACCESS
,
NULL
,
&
hkey
,
NULL
))
...
...
@@ -147,11 +160,28 @@ static void setup_options(void)
ExitProcess
(
1
);
}
/* --display option */
/* open the app-specific key */
if
(
GetModuleFileName16
(
GetCurrentTask
(),
buffer
,
MAX_PATH
)
||
GetModuleFileNameA
(
0
,
buffer
,
MAX_PATH
))
{
HKEY
tmpkey
;
char
*
p
,
*
appname
=
buffer
;
if
((
p
=
strrchr
(
appname
,
'/'
)))
appname
=
p
+
1
;
if
((
p
=
strrchr
(
appname
,
'\\'
)))
appname
=
p
+
1
;
strcat
(
appname
,
"
\\
x11drv"
);
if
(
!
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Wine
\\
Config
\\
AppDefaults"
,
&
tmpkey
))
{
if
(
RegOpenKeyA
(
tmpkey
,
appname
,
&
appkey
))
appkey
=
0
;
RegCloseKey
(
tmpkey
);
}
}
/* get the display name */
strcpy
(
buffer
,
"DISPLAY="
);
count
=
sizeof
(
buffer
)
-
8
;
if
(
!
RegQueryValueExA
(
hkey
,
"display"
,
0
,
&
type
,
buffer
+
8
,
&
count
))
if
(
!
RegQueryValueExA
(
hkey
,
"display"
,
0
,
NULL
,
buffer
+
8
,
&
count
))
{
const
char
*
display_name
=
getenv
(
"DISPLAY"
);
if
(
display_name
&&
strcmp
(
buffer
,
display_name
))
...
...
@@ -160,19 +190,15 @@ static void setup_options(void)
putenv
(
strdup
(
buffer
)
);
}
/* check
and set
--managed option in wine config file if it was not set on command line */
/* check --managed option in wine config file if it was not set on command line */
if
(
!
Options
.
managed
)
{
count
=
sizeof
(
buffer
);
if
(
!
RegQueryValueExA
(
hkey
,
"managed"
,
0
,
&
type
,
buffer
,
&
count
))
if
(
!
get_config_key
(
hkey
,
appkey
,
"Managed"
,
buffer
,
sizeof
(
buffer
)
))
Options
.
managed
=
IS_OPTION_TRUE
(
buffer
[
0
]
);
}
if
(
Options
.
managed
)
RegSetValueExA
(
hkey
,
"managed"
,
0
,
REG_SZ
,
"y"
,
2
);
count
=
sizeof
(
buffer
);
if
(
!
RegQueryValueExA
(
hkey
,
"Desktop"
,
0
,
&
type
,
buffer
,
&
count
))
if
(
!
get_config_key
(
hkey
,
appkey
,
"Desktop"
,
buffer
,
sizeof
(
buffer
)
))
{
/* Imperfect validation: If Desktop=N, then we don't turn on
** the --desktop option. We should really validate for a correct
...
...
@@ -180,18 +206,18 @@ static void setup_options(void)
if
(
!
IS_OPTION_FALSE
(
buffer
[
0
]))
desktop_geometry
=
strdup
(
buffer
);
}
count
=
sizeof
(
buffer
);
screen_depth
=
0
;
if
(
!
RegQueryValueExA
(
hkey
,
"ScreenDepth"
,
0
,
&
type
,
buffer
,
&
count
))
if
(
!
get_config_key
(
hkey
,
appkey
,
"ScreenDepth"
,
buffer
,
sizeof
(
buffer
)
))
screen_depth
=
atoi
(
buffer
);
if
(
!
RegQueryValueExA
(
hkey
,
"Synchronous"
,
0
,
&
type
,
buffer
,
&
count
))
if
(
!
get_config_key
(
hkey
,
appkey
,
"Synchronous"
,
buffer
,
sizeof
(
buffer
)
))
synchronous
=
IS_OPTION_TRUE
(
buffer
[
0
]
);
if
(
appkey
)
RegCloseKey
(
appkey
);
RegCloseKey
(
hkey
);
}
/***********************************************************************
* setup_opengl_visual
*
...
...
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