Closed Bug 265841 Opened 20 years ago Closed 20 years ago

Menus are offset in position

Categories

(Core :: XUL, defect)

x86
OS/2
defect
Not set
major

Tracking

()

VERIFIED FIXED

People

(Reporter: mozilla, Assigned: jag+mozilla)

References

Details

Attachments

(2 files, 2 obsolete files)

In my current builds (since Oct 21st or so) menus and various other UI elements
are offset in position from where they should be, here it is about 150px to the
right and 50px down. I will attach a screenshot shortly.
 I rebuilt after removing the obj-dir and it is still like that. Unfortunately,
the last OS/2 nightly was 2004101808 where everything in that respect was still
OK, so I cannot check with an independent build.

After looking through the checkins between 18th and 22st I suspect that the
patches for bug 264245 are responsible. I have not yet tried to back that out to
check. This seems to be OS/2 only.
Actually, it is more 278px to the right and 188px downwards...
No, that doesn't fix the offset, but instead puts the menus behind the browser
window...
Summary: Menus offset are offset in position → Menus are offset in position
Attached patch try #2 (obsolete) — Splinter Review
hoe about this?
> how about this?

Nope, then they are even farther away.

Status: UNCONFIRMED → NEW
Ever confirmed: true
The position of the menu is dependent on where the window is placed. If the
window is 30 pixels from the left of the desktop, the menu will display 30
pixels to the right in the mozilla window.

So for some reason, the new code is using the position of the window in its
computation or doing some bad coordinage mapping.
Attached patch Hack fixSplinter Review
Robert was not too far off. nsWindow::Resize at
<http://lxr.mozilla.org/seamonkey/source/widget/src/os2/nsWindow.cpp#1444>
already gets the correct x-coordinate, but if it is a popup we only need to
count pixels from bottom instead from the top (using Desktop coordinates. So
the WinMapWindowPoints() is not needed in that case. Don't understand why
eWindowType_popup are special but at least with this patch I get menus,
dropdown boxes etc at the correct position again.

Additionally, I don't understand why every instance of "h" is written as
"GetHeight(h)", which is a function that only returns its argument. When
loading more complex pages this is called a few thousand times. I didn't try to
measure this yet but this might have some performance impact.
Attachment #163249 - Attachment is obsolete: true
Attachment #163255 - Attachment is obsolete: true
Comment on attachment 163497 [details] [diff] [review]
Hack fix

r=mkaply, sr=blizzard (platform specific)

You are correct about GetHeight being unnecessary. It is left over from when we
had subclasses of nsWindow.
Attachment #163497 - Flags: superreview+
Attachment #163497 - Flags: review+
Fix checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Blocks: 264245
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: