Last Comment Bug 296687 - TSM (IME) candidate window is displayed at wrong position (too below)
: TSM (IME) candidate window is displayed at wrong position (too below)
Status: VERIFIED FIXED
[tjp-dl]
: inputmethod, intl, jp-critical, verified1.8.0.2, verified1.8.1
Product: Core
Classification: Components
Component: Internationalization (show other bugs)
: Trunk
: PowerPC Mac OS X
: P1 normal (vote)
: mozilla1.8.1
Assigned To: Katsuhiro MIHARA
: Yuying Long
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-05 03:31 PDT by Katsuhiro MIHARA
Modified: 2010-06-18 18:59 PDT (History)
2 users (show)
dveditz: blocking1.8.0.2+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
change widget for calling LocalToWindowCoordinate() from focusedWidget to mTopLevelWidget. (1.06 KB, patch)
2006-01-07 10:13 PST, Katsuhiro MIHARA
no flags Details | Diff | Review
use TAB as indent (1.05 KB, patch)
2006-01-07 18:31 PST, Katsuhiro MIHARA
jaas: review+
sfraser_bugs: superreview+
jaas: approval‑branch‑1.8.1+
dveditz: approval1.8.0.2+
Details | Diff | Review

Description Katsuhiro MIHARA 2005-06-05 03:31:19 PDT
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050603 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b2) Gecko/20050603 Firefox/1.0+

original report written in Japanese:
http://bugzilla.mozilla.gr.jp/show_bug.cgi?id=4450

Like Bug 235850 and Bug 9526, TSM (IME) candidate window is displayed at wrong
position (too below).

In editing TextField or TextArea, ::LocalToGlobal() revises Point too bellow.

mozilla/widget/src/mac/nsMacEventHandler.cpp, line 1904 - 1917
> nsresult nsMacEventHandler::HandleOffsetToPosition(long offset,Point* thePoint)
> {
> 	thePoint->v = mIMEPos.y;
> 	thePoint->h = mIMEPos.x;
> 	printf("local (x,y) = (%d, %d)\n", thePoint->h, thePoint->v);
> 	WindowRef wind =
reinterpret_cast<WindowRef>(mTopLevelWidget->GetNativeData(NS_NATIVE_DISPLAY));
> 	nsGraphicsUtils::SafeSetPortWindowPort(wind);
> 	Rect savePortRect;
> 	::GetWindowPortBounds(wind, &savePortRect);
> 	::LocalToGlobal(thePoint);
> 	printf("global (x,y) = (%d, %d)\n", thePoint->h, thePoint->v);
> 
> 	return PR_TRUE;
> }

A case, main window touch menu bar, but ::LocalToGlobal() revise Point.v more
than 100px.

> local (x,y) = (131, 96)
> global (x,y) = (130, 204)


Reproducible: Always

Steps to Reproduce:
1.Edit japanese in TextField or TextArea
2.
3.

Actual Results:  
TSM(IME) candidate window touchs edited line.

Expected Results:  
TSM(IME) candidate window is displayed at too below position.
Comment 1 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2006-01-07 06:31:12 PST
O.K.

Mihara-san, please attach the patch.
Let's go to 1.8.1(and 1.8.0.x if it's possible)!
Comment 2 Katsuhiro MIHARA 2006-01-07 10:13:12 PST
Created attachment 207831 [details] [diff] [review]
change widget for calling LocalToWindowCoordinate() from focusedWidget to mTopLevelWidget.

textEvent.theReplay.mCursorPosition.{x,y,height} has mTopLevelWidget's coordinates. So we must call LocalToWindowCoordinate() to mTopLevelWidget.
Comment 3 Katsuhiro MIHARA 2006-01-07 18:31:37 PST
Created attachment 207866 [details] [diff] [review]
use TAB as indent

nsMacEventHandler.cpp uses TAB as indent.
Comment 4 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2006-01-10 07:48:30 PST
This bug is serious usability bug for IME users.
We should block next release.
# The patch has very low risk.
Comment 5 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2006-01-19 09:03:30 PST
Comment on attachment 207866 [details] [diff] [review]
use TAB as indent

Jshin:

Could you review it?
# Asaf Romano is away until Feb 2006.
Comment 6 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2006-02-06 08:39:44 PST
jshin:

Please review this. We hope that this will go to 1.8.0 branch if it's allowed.
Comment 7 Jungshik Shin 2006-02-09 16:29:11 PST
Comment on attachment 207866 [details] [diff] [review]
use TAB as indent

I'm afraid I'm not qualified to review this patch.
Comment 8 Mike Pinkerton (not reading bugmail) 2006-02-10 07:19:15 PST
Comment on attachment 207866 [details] [diff] [review]
use TAB as indent

it's been so long, i'm not either. I know josh has been pouring over this code recently, passing to him.
Comment 9 Josh Aas 2006-02-10 08:19:57 PST
Comment on attachment 207866 [details] [diff] [review]
use TAB as indent

I assume the situation you're trying to correct is when

gEventDispatchHandler.GetActive()

returns something other than mTopLevelWidget and that becomes the focusedWidget. This patch does look like the right thing to do. Also, this is definitely one instance in which tabs are better than spaces (the whole file is indented with tabs!). r=josh
Comment 10 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2006-02-11 08:04:42 PST
checked-in to Trunk.
Comment 11 Hiro 2006-02-15 08:50:04 PST
VERIFIED.

And attachment 207866 [details] [diff] [review] was tested with Thunderbird of 1.8branch.
This doesn't have the problem either. 
 
Mac OS X 10.3.9
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060215 Firefox/1.6a1
Comment 12 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2006-02-15 09:01:53 PST
checked-in to 1.8 branch too.
Thank you for your testing.
Comment 13 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2006-02-15 09:02:38 PST
Comment on attachment 207866 [details] [diff] [review]
use TAB as indent

Let's go to 1.8.0.x. This is critical bug for IME users.
Comment 14 Daniel Veditz [:dveditz] 2006-02-16 12:07:26 PST
Comment on attachment 207866 [details] [diff] [review]
use TAB as indent

approved for 1.8.0 branch, a=dveditz for drivers
Comment 15 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2006-02-17 07:39:36 PST
checked-in to 1.8.0 branch too. Thanks.
Comment 16 Hiro 2006-03-17 11:25:59 PST
VERIFIED.

Thanks!!

1.8/1.8.0branch build.
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.2) Gecko/20060317 Firefox/1.5.0.2
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8) Gecko/20060317 Firefox/2.0a1
Comment 17 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2006-03-17 11:28:11 PST
Thank you for your test.

Note You need to log in before you can comment on or make changes to this bug.