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
c876f250
Commit
c876f250
authored
Oct 18, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Allow specifying system cursor replacements through the registry.
parent
45b87f1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
7 deletions
+47
-7
mouse.c
dlls/winex11.drv/mouse.c
+47
-7
No files found.
dlls/winex11.drv/mouse.c
View file @
c876f250
...
...
@@ -45,10 +45,12 @@ MAKE_FUNCPTR(XcursorLibraryLoadCursor);
#define OEMRESOURCE
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "x11drv.h"
#include "wine/server.h"
#include "wine/library.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
cursor
);
...
...
@@ -704,29 +706,67 @@ static const struct
*/
static
Cursor
create_xcursor_system_cursor
(
const
ICONINFOEXW
*
info
)
{
static
const
WCHAR
idW
[]
=
{
'%'
,
'h'
,
'u'
,
0
};
const
struct
system_cursors
*
cursors
;
unsigned
int
i
;
Cursor
cursor
=
0
;
HMODULE
module
;
HKEY
key
;
WCHAR
*
p
,
name
[
MAX_PATH
*
2
],
valueW
[
64
];
char
valueA
[
64
];
DWORD
size
,
ret
;
if
(
!
pXcursorLibraryLoadCursor
)
return
0
;
if
(
info
->
szResName
[
0
])
return
0
;
/* only integer resources are supported here */
if
(
!
(
module
=
GetModuleHandleW
(
info
->
szModName
)))
return
0
;
if
(
!
info
->
szModName
[
0
])
return
0
;
p
=
strrchrW
(
info
->
szModName
,
'\\'
);
strcpyW
(
name
,
p
?
p
+
1
:
info
->
szModName
);
p
=
name
+
strlenW
(
name
);
*
p
++
=
','
;
if
(
info
->
szResName
[
0
])
strcpyW
(
p
,
info
->
szResName
);
else
sprintfW
(
p
,
idW
,
info
->
wResID
);
valueA
[
0
]
=
0
;
/* @@ Wine registry key: HKCU\Software\Wine\X11 Driver\Cursors */
if
(
!
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
X11 Driver
\\
Cursors"
,
&
key
))
{
size
=
sizeof
(
valueW
)
/
sizeof
(
WCHAR
);
ret
=
RegQueryValueExW
(
key
,
name
,
NULL
,
NULL
,
(
BYTE
*
)
valueW
,
&
size
);
RegCloseKey
(
key
);
if
(
!
ret
)
{
if
(
!
valueW
[
0
])
return
0
;
/* force standard cursor */
if
(
!
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
valueW
,
-
1
,
valueA
,
sizeof
(
valueA
),
NULL
,
NULL
))
valueA
[
0
]
=
0
;
goto
done
;
}
}
if
(
info
->
szResName
[
0
])
goto
done
;
/* only integer resources are supported here */
if
(
!
(
module
=
GetModuleHandleW
(
info
->
szModName
)))
goto
done
;
for
(
i
=
0
;
i
<
sizeof
(
module_cursors
)
/
sizeof
(
module_cursors
[
0
]);
i
++
)
if
(
GetModuleHandleW
(
module_cursors
[
i
].
name
)
==
module
)
break
;
if
(
i
==
sizeof
(
module_cursors
)
/
sizeof
(
module_cursors
[
0
]))
return
0
;
if
(
i
==
sizeof
(
module_cursors
)
/
sizeof
(
module_cursors
[
0
]))
goto
done
;
cursors
=
module_cursors
[
i
].
cursors
;
for
(
i
=
0
;
cursors
[
i
].
id
;
i
++
)
if
(
cursors
[
i
].
id
==
info
->
wResID
)
break
;
for
(
i
=
0
;
cursors
[
i
].
id
;
i
++
)
if
(
cursors
[
i
].
id
==
info
->
wResID
)
{
strcpy
(
valueA
,
cursors
[
i
].
name
);
break
;
}
if
(
cursors
[
i
].
name
)
done:
if
(
valueA
[
0
])
{
wine_tsx11_lock
();
cursor
=
pXcursorLibraryLoadCursor
(
gdi_display
,
cursors
[
i
].
name
);
cursor
=
pXcursorLibraryLoadCursor
(
gdi_display
,
valueA
);
wine_tsx11_unlock
();
if
(
!
cursor
)
WARN
(
"no library cursor found for %s
\n
"
,
debugstr_a
(
cursors
[
i
].
name
)
);
if
(
!
cursor
)
WARN
(
"no system cursor found for %s mapped to %s
\n
"
,
debugstr_w
(
name
),
debugstr_a
(
valueA
)
);
}
else
WARN
(
"no system cursor found for %s
\n
"
,
debugstr_w
(
name
)
);
return
cursor
;
}
...
...
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