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
bd721f03
Commit
bd721f03
authored
Apr 28, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Apr 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Directly use ntdll for utf8 conversion.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6afcd71a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
+15
-11
clipboard.c
dlls/winex11.drv/clipboard.c
+5
-6
window.c
dlls/winex11.drv/window.c
+4
-3
xrandr.c
dlls/winex11.drv/xrandr.c
+6
-2
No files found.
dlls/winex11.drv/clipboard.c
View file @
bd721f03
...
@@ -914,12 +914,11 @@ static void *import_text_html( Atom type, const void *data, size_t size, size_t
...
@@ -914,12 +914,11 @@ static void *import_text_html( Atom type, const void *data, size_t size, size_t
/* Firefox uses UTF-16LE with byte order mark. Convert to UTF-8 without the BOM. */
/* Firefox uses UTF-16LE with byte order mark. Convert to UTF-8 without the BOM. */
if
(
size
>=
sizeof
(
WCHAR
)
&&
((
const
WCHAR
*
)
data
)[
0
]
==
0xfeff
)
if
(
size
>=
sizeof
(
WCHAR
)
&&
((
const
WCHAR
*
)
data
)[
0
]
==
0xfeff
)
{
{
len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
(
const
WCHAR
*
)
data
+
1
,
size
/
sizeof
(
WCHAR
)
-
1
,
DWORD
str_len
;
NULL
,
0
,
NULL
,
NULL
);
RtlUnicodeToUTF8N
(
NULL
,
0
,
&
str_len
,
(
const
WCHAR
*
)
data
+
1
,
size
-
sizeof
(
WCHAR
)
);
if
(
!
(
text
=
malloc
(
len
)))
return
0
;
if
(
!
(
text
=
malloc
(
str_len
)))
return
NULL
;
WideCharToMultiByte
(
CP_UTF8
,
0
,
(
const
WCHAR
*
)
data
+
1
,
size
/
sizeof
(
WCHAR
)
-
1
,
RtlUnicodeToUTF8N
(
text
,
str_len
,
&
str_len
,
(
const
WCHAR
*
)
data
+
1
,
size
-
sizeof
(
WCHAR
)
);
text
,
len
,
NULL
,
NULL
);
size
=
str_len
;
size
=
len
;
data
=
text
;
data
=
text
;
}
}
...
...
dlls/winex11.drv/window.c
View file @
bd721f03
...
@@ -437,22 +437,23 @@ static void sync_window_opacity( Display *display, Window win,
...
@@ -437,22 +437,23 @@ static void sync_window_opacity( Display *display, Window win,
*/
*/
static
void
sync_window_text
(
Display
*
display
,
Window
win
,
const
WCHAR
*
text
)
static
void
sync_window_text
(
Display
*
display
,
Window
win
,
const
WCHAR
*
text
)
{
{
UINT
count
;
DWORD
count
,
len
;
char
*
buffer
,
*
utf8_buffer
;
char
*
buffer
,
*
utf8_buffer
;
XTextProperty
prop
;
XTextProperty
prop
;
/* allocate new buffer for window text */
/* allocate new buffer for window text */
len
=
lstrlenW
(
text
);
count
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
text
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
count
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
text
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
!
(
buffer
=
malloc
(
count
)))
return
;
if
(
!
(
buffer
=
malloc
(
count
)))
return
;
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
text
,
-
1
,
buffer
,
count
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
text
,
-
1
,
buffer
,
count
,
NULL
,
NULL
);
count
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
text
,
strlenW
(
text
),
NULL
,
0
,
NULL
,
NULL
);
RtlUnicodeToUTF8N
(
NULL
,
0
,
&
count
,
text
,
len
*
sizeof
(
WCHAR
)
);
if
(
!
(
utf8_buffer
=
malloc
(
count
)))
if
(
!
(
utf8_buffer
=
malloc
(
count
)))
{
{
free
(
buffer
);
free
(
buffer
);
return
;
return
;
}
}
WideCharToMultiByte
(
CP_UTF8
,
0
,
text
,
strlenW
(
text
),
utf8_buffer
,
count
,
NULL
,
NULL
);
RtlUnicodeToUTF8N
(
utf8_buffer
,
count
,
&
count
,
text
,
len
*
sizeof
(
WCHAR
)
);
if
(
XmbTextListToTextProperty
(
display
,
&
buffer
,
1
,
XStdICCTextStyle
,
&
prop
)
==
Success
)
if
(
XmbTextListToTextProperty
(
display
,
&
buffer
,
1
,
XStdICCTextStyle
,
&
prop
)
==
Success
)
{
{
...
...
dlls/winex11.drv/xrandr.c
View file @
bd721f03
...
@@ -652,6 +652,7 @@ static BOOL get_gpu_properties_from_vulkan( struct gdi_gpu *gpu, const XRRProvid
...
@@ -652,6 +652,7 @@ static BOOL get_gpu_properties_from_vulkan( struct gdi_gpu *gpu, const XRRProvid
VkPhysicalDeviceIDProperties
id
;
VkPhysicalDeviceIDProperties
id
;
VkInstance
vk_instance
=
NULL
;
VkInstance
vk_instance
=
NULL
;
VkDisplayKHR
vk_display
;
VkDisplayKHR
vk_display
;
DWORD
len
;
BOOL
ret
=
FALSE
;
BOOL
ret
=
FALSE
;
VkResult
vr
;
VkResult
vr
;
...
@@ -723,7 +724,8 @@ static BOOL get_gpu_properties_from_vulkan( struct gdi_gpu *gpu, const XRRProvid
...
@@ -723,7 +724,8 @@ static BOOL get_gpu_properties_from_vulkan( struct gdi_gpu *gpu, const XRRProvid
gpu
->
vendor_id
=
properties2
.
properties
.
vendorID
;
gpu
->
vendor_id
=
properties2
.
properties
.
vendorID
;
gpu
->
device_id
=
properties2
.
properties
.
deviceID
;
gpu
->
device_id
=
properties2
.
properties
.
deviceID
;
}
}
MultiByteToWideChar
(
CP_UTF8
,
0
,
properties2
.
properties
.
deviceName
,
-
1
,
gpu
->
name
,
ARRAY_SIZE
(
gpu
->
name
)
);
RtlUTF8ToUnicodeN
(
gpu
->
name
,
sizeof
(
gpu
->
name
),
&
len
,
properties2
.
properties
.
deviceName
,
strlen
(
properties2
.
properties
.
deviceName
)
+
1
);
ret
=
TRUE
;
ret
=
TRUE
;
goto
done
;
goto
done
;
}
}
...
@@ -749,6 +751,7 @@ static BOOL xrandr14_get_gpus2( struct gdi_gpu **new_gpus, int *count, BOOL get_
...
@@ -749,6 +751,7 @@ static BOOL xrandr14_get_gpus2( struct gdi_gpu **new_gpus, int *count, BOOL get_
INT
primary_provider
=
-
1
;
INT
primary_provider
=
-
1
;
RECT
primary_rect
;
RECT
primary_rect
;
BOOL
ret
=
FALSE
;
BOOL
ret
=
FALSE
;
DWORD
len
;
INT
i
,
j
;
INT
i
,
j
;
screen_resources
=
xrandr_get_screen_resources
();
screen_resources
=
xrandr_get_screen_resources
();
...
@@ -803,7 +806,8 @@ static BOOL xrandr14_get_gpus2( struct gdi_gpu **new_gpus, int *count, BOOL get_
...
@@ -803,7 +806,8 @@ static BOOL xrandr14_get_gpus2( struct gdi_gpu **new_gpus, int *count, BOOL get_
if
(
get_properties
)
if
(
get_properties
)
{
{
if
(
!
get_gpu_properties_from_vulkan
(
&
gpus
[
i
],
provider_info
))
if
(
!
get_gpu_properties_from_vulkan
(
&
gpus
[
i
],
provider_info
))
MultiByteToWideChar
(
CP_UTF8
,
0
,
provider_info
->
name
,
-
1
,
gpus
[
i
].
name
,
ARRAY_SIZE
(
gpus
[
i
].
name
)
);
RtlUTF8ToUnicodeN
(
gpus
[
i
].
name
,
sizeof
(
gpus
[
i
].
name
),
&
len
,
provider_info
->
name
,
strlen
(
provider_info
->
name
)
+
1
);
/* FIXME: Add an alternate method of getting PCI IDs, for systems that don't support Vulkan */
/* FIXME: Add an alternate method of getting PCI IDs, for systems that don't support Vulkan */
}
}
pXRRFreeProviderInfo
(
provider_info
);
pXRRFreeProviderInfo
(
provider_info
);
...
...
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