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
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)
...
@@ -1981,6 +1981,7 @@ static void PaintDefaultIMEWnd(HWND hwnd)
LPBYTE
compdata
=
NULL
;
LPBYTE
compdata
=
NULL
;
HMONITOR
monitor
;
HMONITOR
monitor
;
MONITORINFO
mon_info
;
MONITORINFO
mon_info
;
INT
offX
=
0
,
offY
=
0
;
GetClientRect
(
hwnd
,
&
rect
);
GetClientRect
(
hwnd
,
&
rect
);
FillRect
(
hdc
,
&
rect
,
(
HBRUSH
)(
COLOR_WINDOW
+
1
));
FillRect
(
hdc
,
&
rect
,
(
HBRUSH
)(
COLOR_WINDOW
+
1
));
...
@@ -2005,24 +2006,30 @@ static void PaintDefaultIMEWnd(HWND hwnd)
...
@@ -2005,24 +2006,30 @@ static void PaintDefaultIMEWnd(HWND hwnd)
pt
.
y
=
size
.
cy
;
pt
.
y
=
size
.
cy
;
LPtoDP
(
hdc
,
&
pt
,
1
);
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
;
POINT
cpt
=
root_context
->
IMC
.
cfCompForm
.
ptCurrentPos
;
ClientToScreen
(
root_context
->
IMC
.
hWnd
,
&
cpt
);
ClientToScreen
(
root_context
->
IMC
.
hWnd
,
&
cpt
);
rect
.
left
=
cpt
.
x
;
rect
.
left
=
cpt
.
x
;
rect
.
top
=
cpt
.
y
;
rect
.
top
=
cpt
.
y
;
rect
.
right
=
rect
.
left
+
pt
.
x
+
20
;
rect
.
right
=
rect
.
left
+
pt
.
x
;
rect
.
bottom
=
rect
.
top
+
pt
.
y
+
20
;
rect
.
bottom
=
rect
.
top
+
pt
.
y
;
offX
=
offY
=
10
;
monitor
=
MonitorFromPoint
(
cpt
,
MONITOR_DEFAULTTOPRIMARY
);
monitor
=
MonitorFromPoint
(
cpt
,
MONITOR_DEFAULTTOPRIMARY
);
}
}
else
if
(
root_context
->
IMC
.
cfCompForm
.
dwStyle
==
CFS_RECT
)
else
/* CFS_DEFAULT */
{
rect
=
root_context
->
IMC
.
cfCompForm
.
rcArea
;
MapWindowPoints
(
root_context
->
IMC
.
hWnd
,
0
,
(
POINT
*
)
&
rect
,
2
);
monitor
=
MonitorFromRect
(
&
rect
,
MONITOR_DEFAULTTOPRIMARY
);
}
else
{
{
/* Windows places the default IME window in the bottom left */
/* Windows places the default IME window in the bottom left */
HWND
target
=
root_context
->
IMC
.
hWnd
;
HWND
target
=
root_context
->
IMC
.
hWnd
;
...
@@ -2032,34 +2039,47 @@ static void PaintDefaultIMEWnd(HWND hwnd)
...
@@ -2032,34 +2039,47 @@ static void PaintDefaultIMEWnd(HWND hwnd)
rect
.
top
=
rect
.
bottom
;
rect
.
top
=
rect
.
bottom
;
rect
.
right
=
rect
.
left
+
pt
.
x
+
20
;
rect
.
right
=
rect
.
left
+
pt
.
x
+
20
;
rect
.
bottom
=
rect
.
top
+
pt
.
y
+
20
;
rect
.
bottom
=
rect
.
top
+
pt
.
y
+
20
;
offX
=
offY
=
10
;
monitor
=
MonitorFromWindow
(
target
,
MONITOR_DEFAULTTOPRIMARY
);
monitor
=
MonitorFromWindow
(
target
,
MONITOR_DEFAULTTOPRIMARY
);
}
}
/* make sure we are on the desktop */
if
(
root_context
->
IMC
.
cfCompForm
.
dwStyle
==
CFS_RECT
)
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
client
;
rect
.
left
=
0
;
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
;
/* make sure we are on the desktop */
rect
.
left
-=
shift
;
mon_info
.
cbSize
=
sizeof
(
mon_info
);
rect
.
right
-=
shift
;
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
);
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
)
if
(
oldfont
)
SelectObject
(
hdc
,
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