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
560ca323
Commit
560ca323
authored
Oct 02, 2001
by
Ilya Konstantinov
Committed by
Alexandre Julliard
Oct 02, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a _NET_WM_NAME(UTF8_STRING) property to every window.
parent
676eb230
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
window.c
dlls/x11drv/window.c
+22
-0
No files found.
dlls/x11drv/window.c
View file @
560ca323
...
...
@@ -17,6 +17,7 @@
#include "wingdi.h"
#include "winreg.h"
#include "winuser.h"
#include "wine/unicode.h"
#include "debugtools.h"
#include "x11drv.h"
...
...
@@ -714,6 +715,7 @@ BOOL X11DRV_SetWindowText( HWND hwnd, LPCWSTR text )
Display
*
display
=
thread_display
();
UINT
count
;
char
*
buffer
;
char
*
utf8_buffer
;
static
UINT
text_cp
=
(
UINT
)
-
1
;
Window
win
;
WND
*
wndPtr
=
WIN_FindWndPtr
(
hwnd
);
...
...
@@ -747,11 +749,31 @@ BOOL X11DRV_SetWindowText( HWND hwnd, LPCWSTR text )
}
WideCharToMultiByte
(
text_cp
,
0
,
text
,
-
1
,
buffer
,
count
,
NULL
,
NULL
);
count
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
text
,
strlenW
(
text
),
NULL
,
0
,
NULL
,
NULL
);
if
(
!
(
utf8_buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
)))
{
ERR
(
"Not enough memory for window text in UTF-8
\n
"
);
WIN_ReleaseWndPtr
(
wndPtr
);
return
FALSE
;
}
WideCharToMultiByte
(
CP_UTF8
,
0
,
text
,
strlenW
(
text
),
utf8_buffer
,
count
,
NULL
,
NULL
);
wine_tsx11_lock
();
XStoreName
(
display
,
win
,
buffer
);
XSetIconName
(
display
,
win
,
buffer
);
/*
Implements a NET_WM UTF-8 title. It should be without a trailing \0,
according to the standard
( http://www.pps.jussieu.fr/~jch/software/UTF8_STRING/UTF8_STRING.text ).
*/
XChangeProperty
(
display
,
win
,
XInternAtom
(
display
,
"_NET_WM_NAME"
,
False
),
XInternAtom
(
display
,
"UTF8_STRING"
,
False
),
8
,
PropModeReplace
,
(
unsigned
char
*
)
utf8_buffer
,
count
);
wine_tsx11_unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
utf8_buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
WIN_ReleaseWndPtr
(
wndPtr
);
...
...
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