Closed
Bug 335810
Opened 19 years ago
Closed 18 years ago
cursor up/down keypresses do not preserve horizontal position when using pango
Categories
(Core :: Layout: Form Controls, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: iwj, Assigned: caillon)
References
Details
Attachments
(1 file)
1.77 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060413 Ubuntu/dapper Firefox/1.5.0.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060413 Ubuntu/dapper Firefox/1.5.0.1
To reproduce:
Build Firefox 1.5.0.2 with pango support enabled, eg as we do in Ubuntu: ./configure ... --enable-default-toolkit=gtk2 --enable-pango --enable-system-cairo --enable-xft ...
Enter several lines of text in a text entry box (like the one I'm typing into now).
Try positioning the cursor in various places and then pressing the up and down arrow keys.
The cursor inevitably goes either to the beginning of the target line, or the end, even if the horizontal position in the original line is within the horizontal extent of the target line. This is suboptimal and can make editing difficult.
When I run with MOZ_DISABLE_PANGO=1, I see the desired behaviour: the horizontal position of the cursor is largely preserved.
This bug was reported by an Ubuntu user in our bug system, at
https://launchpad.net/distros/ubuntu/+source/firefox/+bug/36571
Reproducible: Always
Comment 1•19 years ago
|
||
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9a1) Gecko/20060426 Minefield/3.0a1 - Build ID: 0000000000
WFM with Pango and Cairo enabled, and it has done for as long as I can remember.
This bug is really, really annoying, and appears on:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.2) Gecko/Debian-1.5.dfsg+1.5.0.2-3 Firefox/1.5.0.2
Reporter | ||
Comment 3•19 years ago
|
||
Just for reference, the Debian bug report about this is:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=365132
I have tested the upstream binary build for Linux i686 of 1.5.0.3 on Ubuntu and I can't reproduce the bug in that case. I will investigate some more
It's appearing in Fedora's build, as well.
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=198759
(In reply to comment #3)
> Just for reference, the Debian bug report about this is:
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=365132
>
> I have tested the upstream binary build for Linux i686 of 1.5.0.3 on Ubuntu and
> I can't reproduce the bug in that case. I will investigate some more
>
I'm seeing this on a Gentoo system with SeaMonkey 1.0.4 too and it makes it
quite unusable.
I did some primitive debugging with printf's and believe that the bug is here:
http://lxr.mozilla.org/seamonkey/source/gfx/src/gtk/nsFontMetricsPango.cpp#987
pango_layout_xy_to_index() returns always FALSE when I'm moving the cursor up
or down in textboxes. This may be expected behavior because it's no error
indication but simply a flag telling if the position is inside the text frame,
and probably it's always outside because of non-matching y position.
I guess removing
// Jump to the end if it's not found.
if (!found) {
if (inx == 0)
retval = 0;
else if (trailing)
retval = aLength;
goto loser;
}
will fix this bug. Also note the missing |else| here. |trailing| ist TRUE by
random when moving up or down within text.
Also, AIUI, we shouldn't use pango_layout_xy_to_index() at all here, but
pango_layout_line_x_to_index().
Another bug is in
http://lxr.mozilla.org/seamonkey/source/layout/generic/nsTextFrame.cpp#4135
because error checking is missing there. |indx| may be -1 to indicate an
error. If that's the case the code should fall back to internal calculation
of the position.
I'm not going to investigate this in more depth because I'll switch to
MOZ_DISABLE_PANGO=1 anyways. Performance isn't acceptable with Pango on my
low-end box.
Component of this bug probably should be Core / GFX: Gtk, but I'm not allowed
to change it. And the normal component of <textarea> bugs would be
Core / Editor AFAIK.
Just for reference, the Gentoo bug report about this is
https://bugs.gentoo.org/show_bug.cgi?id=122464
Assignee | ||
Comment 7•18 years ago
|
||
Patch by tagoh and behdad upstreamed from https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=198759
Attachment #236935 -
Flags: superreview?(roc)
Attachment #236935 -
Flags: review?(roc)
Attachment #236935 -
Flags: superreview?(roc)
Attachment #236935 -
Flags: superreview+
Attachment #236935 -
Flags: review?(roc)
Attachment #236935 -
Flags: review+
Updated•18 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•18 years ago
|
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
See Also: → https://launchpad.net/bugs/36571
You need to log in
before you can comment on or make changes to this bug.
Description
•