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
bf9a649e
Commit
bf9a649e
authored
Apr 01, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Add a helper to select IME private font.
parent
904ddc7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
ime.c
dlls/winex11.drv/ime.c
+14
-12
No files found.
dlls/winex11.drv/ime.c
View file @
bf9a649e
...
...
@@ -49,7 +49,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(imm);
#define FROM_X11 ((HIMC)0xcafe1337)
typedef
struct
_IMEPRIVATE
{
typedef
struct
ime_private
{
BOOL
bInComposition
;
BOOL
bInternalState
;
HFONT
textfont
;
...
...
@@ -91,6 +92,16 @@ static WCHAR *input_context_get_comp_str( INPUTCONTEXT *ctx, BOOL result, UINT *
return
text
;
}
static
HFONT
input_context_select_ui_font
(
INPUTCONTEXT
*
ctx
,
HDC
hdc
)
{
struct
ime_private
*
priv
;
HFONT
font
=
NULL
;
if
(
!
(
priv
=
ImmLockIMCC
(
ctx
->
hPrivate
)))
return
NULL
;
if
(
priv
->
textfont
)
font
=
SelectObject
(
hdc
,
priv
->
textfont
);
ImmUnlockIMCC
(
ctx
->
hPrivate
);
return
font
;
}
static
LRESULT
WINAPI
IME_WindowProc
(
HWND
hwnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
);
...
...
@@ -1010,17 +1021,9 @@ static void PaintDefaultIMEWnd(HIMC hIMC, HWND hwnd)
if
((
str
=
input_context_get_comp_str
(
lpIMC
,
FALSE
,
&
len
)))
{
HFONT
font
=
input_context_select_ui_font
(
lpIMC
,
hdc
);
SIZE
size
;
POINT
pt
;
HFONT
oldfont
=
NULL
;
LPIMEPRIVATE
myPrivate
;
myPrivate
=
ImmLockIMCC
(
lpIMC
->
hPrivate
);
if
(
myPrivate
->
textfont
)
oldfont
=
SelectObject
(
hdc
,
myPrivate
->
textfont
);
ImmUnlockIMCC
(
lpIMC
->
hPrivate
);
GetTextExtentPoint32W
(
hdc
,
str
,
len
,
&
size
);
pt
.
x
=
size
.
cx
;
...
...
@@ -1101,8 +1104,7 @@ static void PaintDefaultIMEWnd(HIMC hIMC, HWND hwnd)
TextOutW
(
hdc
,
offX
,
offY
,
str
,
len
);
if
(
oldfont
)
SelectObject
(
hdc
,
oldfont
);
if
(
font
)
SelectObject
(
hdc
,
font
);
free
(
str
);
}
...
...
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