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
7f83b940
Commit
7f83b940
authored
Sep 05, 2007
by
Aric Stewart
Committed by
Alexandre Julliard
Sep 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Further tweeks to CFS_POINT and CFS_RECT placement of the default ime window.
parent
3822aa4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
29 deletions
+49
-29
imm.c
dlls/imm32/imm.c
+49
-29
No files found.
dlls/imm32/imm.c
View file @
7f83b940
...
...
@@ -1981,6 +1981,7 @@ static void PaintDefaultIMEWnd(HWND hwnd)
LPBYTE
compdata
=
NULL
;
HMONITOR
monitor
;
MONITORINFO
mon_info
;
INT
offX
=
0
,
offY
=
0
;
GetClientRect
(
hwnd
,
&
rect
);
FillRect
(
hdc
,
&
rect
,
(
HBRUSH
)(
COLOR_WINDOW
+
1
));
...
...
@@ -2005,24 +2006,30 @@ static void PaintDefaultIMEWnd(HWND hwnd)
pt
.
y
=
size
.
cy
;
LPtoDP
(
hdc
,
&
pt
,
1
);
if
(
root_context
->
IMC
.
cfCompForm
.
dwStyle
==
CFS_POINT
||
root_context
->
IMC
.
cfCompForm
.
dwStyle
==
CFS_FORCE_POSITION
)
/*
* How this works based on tests on windows:
* CFS_POINT: then we start our window at the point and grow it as large
* as it needs to be for the string.
* CFS_RECT: we still use the ptCurrentPos as a starting point and our
* window is only as large as we need for the string, but we do not
* grow such that our window exceeds the given rect. Wrapping if
* needed and possible. If our ptCurrentPos is outside of our rect
* then no window is displayed.
* CFS_FORCE_POSITION: appears to behave just like CFS_POINT
* maybe becase the default MSIME does not do any IME adjusting.
*/
if
(
root_context
->
IMC
.
cfCompForm
.
dwStyle
!=
CFS_DEFAULT
)
{
POINT
cpt
=
root_context
->
IMC
.
cfCompForm
.
ptCurrentPos
;
ClientToScreen
(
root_context
->
IMC
.
hWnd
,
&
cpt
);
rect
.
left
=
cpt
.
x
;
rect
.
top
=
cpt
.
y
;
rect
.
right
=
rect
.
left
+
pt
.
x
+
20
;
rect
.
bottom
=
rect
.
top
+
pt
.
y
+
20
;
rect
.
right
=
rect
.
left
+
pt
.
x
;
rect
.
bottom
=
rect
.
top
+
pt
.
y
;
offX
=
offY
=
10
;
monitor
=
MonitorFromPoint
(
cpt
,
MONITOR_DEFAULTTOPRIMARY
);
}
else
if
(
root_context
->
IMC
.
cfCompForm
.
dwStyle
==
CFS_RECT
)
{
rect
=
root_context
->
IMC
.
cfCompForm
.
rcArea
;
MapWindowPoints
(
root_context
->
IMC
.
hWnd
,
0
,
(
POINT
*
)
&
rect
,
2
);
monitor
=
MonitorFromRect
(
&
rect
,
MONITOR_DEFAULTTOPRIMARY
);
}
else
else
/* CFS_DEFAULT */
{
/* Windows places the default IME window in the bottom left */
HWND
target
=
root_context
->
IMC
.
hWnd
;
...
...
@@ -2032,34 +2039,47 @@ static void PaintDefaultIMEWnd(HWND hwnd)
rect
.
top
=
rect
.
bottom
;
rect
.
right
=
rect
.
left
+
pt
.
x
+
20
;
rect
.
bottom
=
rect
.
top
+
pt
.
y
+
20
;
offX
=
offY
=
10
;
monitor
=
MonitorFromWindow
(
target
,
MONITOR_DEFAULTTOPRIMARY
);
}
/* make sure we are on the desktop */
mon_info
.
cbSize
=
sizeof
(
mon_info
);
GetMonitorInfoW
(
monitor
,
&
mon_info
);
if
(
rect
.
bottom
>
mon_info
.
rcWork
.
bottom
)
{
int
shift
=
rect
.
bottom
-
mon_info
.
rcWork
.
bottom
;
rect
.
top
-=
shift
;
rect
.
bottom
-=
shift
;
}
if
(
rect
.
left
<
0
)
if
(
root_context
->
IMC
.
cfCompForm
.
dwStyle
==
CFS_RECT
)
{
rect
.
right
-=
rect
.
left
;
rect
.
left
=
0
;
RECT
client
;
client
=
root_context
->
IMC
.
cfCompForm
.
rcArea
;
MapWindowPoints
(
root_context
->
IMC
.
hWnd
,
0
,
(
POINT
*
)
&
client
,
2
);
IntersectRect
(
&
rect
,
&
rect
,
&
client
);
/* TODO: Wrap the input if needed */
}
if
(
rect
.
right
>
mon_info
.
rcWork
.
right
)
if
(
root_context
->
IMC
.
cfCompForm
.
dwStyle
==
CFS_DEFAULT
)
{
int
shift
=
rect
.
right
-
mon_info
.
rcWork
.
right
;
rect
.
left
-=
shift
;
rect
.
right
-=
shift
;
/* make sure we are on the desktop */
mon_info
.
cbSize
=
sizeof
(
mon_info
);
GetMonitorInfoW
(
monitor
,
&
mon_info
);
if
(
rect
.
bottom
>
mon_info
.
rcWork
.
bottom
)
{
int
shift
=
rect
.
bottom
-
mon_info
.
rcWork
.
bottom
;
rect
.
top
-=
shift
;
rect
.
bottom
-=
shift
;
}
if
(
rect
.
left
<
0
)
{
rect
.
right
-=
rect
.
left
;
rect
.
left
=
0
;
}
if
(
rect
.
right
>
mon_info
.
rcWork
.
right
)
{
int
shift
=
rect
.
right
-
mon_info
.
rcWork
.
right
;
rect
.
left
-=
shift
;
rect
.
right
-=
shift
;
}
}
SetWindowPos
(
hwnd
,
HWND_TOPMOST
,
rect
.
left
,
rect
.
top
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
,
SWP_NOACTIVATE
);
TextOutW
(
hdc
,
10
,
10
,
CompString
,
compstr
->
dwCompStrLen
);
TextOutW
(
hdc
,
offX
,
offY
,
CompString
,
compstr
->
dwCompStrLen
);
if
(
oldfont
)
SelectObject
(
hdc
,
oldfont
);
...
...
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