Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
fc21a83a
Commit
fc21a83a
authored
Jul 17, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Store the process name at startup to avoid grabbing the loader lock again.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
52d90e3c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
40 deletions
+15
-40
window.c
dlls/winex11.drv/window.c
+0
-33
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-0
x11drv_main.c
dlls/winex11.drv/x11drv_main.c
+14
-7
No files found.
dlls/winex11.drv/window.c
View file @
fc21a83a
...
...
@@ -803,38 +803,6 @@ static void set_style_hints( struct x11drv_win_data *data, DWORD style, DWORD ex
/***********************************************************************
* get_process_name
*
* get the name of the current process for setting class hints
*/
static
char
*
get_process_name
(
void
)
{
static
char
*
name
;
if
(
!
name
)
{
WCHAR
module
[
MAX_PATH
];
DWORD
len
=
GetModuleFileNameW
(
0
,
module
,
MAX_PATH
);
if
(
len
&&
len
<
MAX_PATH
)
{
char
*
ptr
;
WCHAR
*
p
,
*
appname
=
module
;
if
((
p
=
strrchrW
(
appname
,
'/'
)))
appname
=
p
+
1
;
if
((
p
=
strrchrW
(
appname
,
'\\'
)))
appname
=
p
+
1
;
len
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
appname
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
ptr
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
{
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
appname
,
-
1
,
ptr
,
len
,
NULL
,
NULL
);
name
=
ptr
;
}
}
}
return
name
;
}
/***********************************************************************
* set_initial_wm_hints
*
* Set the window manager hints that don't change over the lifetime of a window.
...
...
@@ -845,7 +813,6 @@ static void set_initial_wm_hints( Display *display, Window window )
Atom
protocols
[
3
];
Atom
dndVersion
=
WINE_XDND_VERSION
;
XClassHint
*
class_hints
;
char
*
process_name
=
get_process_name
();
/* wm protocols */
i
=
0
;
...
...
dlls/winex11.drv/x11drv.h
View file @
fc21a83a
...
...
@@ -395,6 +395,7 @@ extern int copy_default_colors DECLSPEC_HIDDEN;
extern
int
alloc_system_colors
DECLSPEC_HIDDEN
;
extern
int
xrender_error_base
DECLSPEC_HIDDEN
;
extern
HMODULE
x11drv_module
DECLSPEC_HIDDEN
;
extern
char
*
process_name
DECLSPEC_HIDDEN
;
extern
Display
*
clipboard_display
DECLSPEC_HIDDEN
;
/* atoms */
...
...
dlls/winex11.drv/x11drv_main.c
View file @
fc21a83a
...
...
@@ -49,6 +49,7 @@
#include "x11drv.h"
#include "xcomposite.h"
#include "wine/server.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/library.h"
...
...
@@ -84,6 +85,7 @@ int alloc_system_colors = 256;
DWORD
thread_data_tls_index
=
TLS_OUT_OF_INDEXES
;
int
xrender_error_base
=
0
;
HMODULE
x11drv_module
=
0
;
char
*
process_name
=
NULL
;
static
x11drv_error_callback
err_callback
;
/* current callback for error */
static
Display
*
err_callback_display
;
/* display callback is set for */
...
...
@@ -323,7 +325,9 @@ static inline DWORD get_config_key( HKEY defkey, HKEY appkey, const char *name,
*/
static
void
setup_options
(
void
)
{
char
buffer
[
MAX_PATH
+
16
];
static
const
WCHAR
x11driverW
[]
=
{
'\\'
,
'X'
,
'1'
,
'1'
,
' '
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
0
};
char
buffer
[
64
];
WCHAR
bufferW
[
MAX_PATH
+
16
];
HKEY
hkey
,
appkey
=
0
;
DWORD
len
;
...
...
@@ -332,18 +336,21 @@ static void setup_options(void)
/* open the app-specific key */
len
=
(
GetModuleFileName
A
(
0
,
buffer
,
MAX_PATH
));
len
=
(
GetModuleFileName
W
(
0
,
bufferW
,
MAX_PATH
));
if
(
len
&&
len
<
MAX_PATH
)
{
HKEY
tmpkey
;
char
*
p
,
*
appname
=
buffer
;
if
((
p
=
strrchr
(
appname
,
'/'
)))
appname
=
p
+
1
;
if
((
p
=
strrchr
(
appname
,
'\\'
)))
appname
=
p
+
1
;
strcat
(
appname
,
"
\\
X11 Driver"
);
WCHAR
*
p
,
*
appname
=
bufferW
;
if
((
p
=
strrchrW
(
appname
,
'/'
)))
appname
=
p
+
1
;
if
((
p
=
strrchrW
(
appname
,
'\\'
)))
appname
=
p
+
1
;
len
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
appname
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
((
process_name
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
appname
,
-
1
,
process_name
,
len
,
NULL
,
NULL
);
strcatW
(
appname
,
x11driverW
);
/* @@ Wine registry key: HKCU\Software\Wine\AppDefaults\app.exe\X11 Driver */
if
(
!
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
AppDefaults"
,
&
tmpkey
))
{
if
(
RegOpenKey
A
(
tmpkey
,
appname
,
&
appkey
))
appkey
=
0
;
if
(
RegOpenKey
W
(
tmpkey
,
appname
,
&
appkey
))
appkey
=
0
;
RegCloseKey
(
tmpkey
);
}
}
...
...
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