Closed
Bug 120226
Opened 23 years ago
Closed 23 years ago
Can't show system hint message when browser maximize
Categories
(Core :: XUL, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jerry.tan, Assigned: jerry.tan)
Details
(Keywords: fixedOEM)
Attachments
(1 file, 4 obsolete files)
|
1.23 KB,
patch
|
bryner
:
review+
hewitt
:
superreview+
|
Details | Diff | Splinter Review |
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
BuildID: 20020111
when we let the mouse pointer over the icon on the left-bottem of browser.we
will see some system hint message,such as"Navigator","Mail&Newsgourps","Address
Book"
But When the browser is maximized, you can not see the hint message.
Reproducible: Always
Steps to Reproduce:
1.open browser
2.maximize it
3.move mouse to left-bottom of browser, stop on some icons for some time
Actual Results: nothing happened
Expected Results: some hint message shows
the windows manager is CDE
When I check netscape 4.7 on solaris, I notice that if browser is maximised,
hint message will appear on the screen above on the status bar.If browser is
not maximised, hint message will appear on the screen at the bottom of the
status bar.
Mark as NEW. Problem exist. Mozilla always shows hints (tooltips) under
pointed object. When window is maximized, these hints are outside of screen.
Status: UNCONFIRMED → NEW
Ever confirmed: true
When I check the sourcecode of 094,
I find that
in content/xul/content/src/nsXULPopupListener.cpp
XULPopupListenerImpl :: sTooltipCallback()
......
if ( targetDoc ) {
doc->SetTooltipNode ( self->mPossibleTooltipNode );
doc->SetPopupNode ( self->mPossibleTooltipNode );
self->LaunchPopup ( self->mMouseClientX, self->mMouseClientY+21)
...
I think I get the point.
It doesnot calculate the window's Y value,
just +21,
if we change the code like this
maxY=the current maximised window's Y value
if(self->mMouseClientY>maxY-21)
{
self->LaunchPopup ( self->mMouseClientX, self->mMouseClientY-
21);
}
else
{
self->LaunchPopup ( self->mMouseClientX, self-
>mMouseClientY+21);
}
That will resolve this problem.
But I dont know how to get MaxY in this function.
Anyone can give some tip?
Not a good idea, I think. Tooltip should not overlap object (see netscape 4.xx).
Also, this coordinates are inside of window, but we should operate with
global event coordinates and global maxY to check if tooltip become outside
of screen.
the patch check the visiable area of current contaxt,
if ypos is bigger than the width, it is out of sight,
so Ypos should be minus 42
Fix for bug, recalculate ypos for tooltip.
Attachment #66424 -
Attachment is obsolete: true
Previous ideas was wrong. I've found mozilla have code for placeing
tooltip (as popups to screen if it's outside screen. But if window
maximised, we place tooltip just under mouse, and have leave event for
widget. So, we switch tooltip off before we can see it (you can notice
that cursor switch to standard X cursor "cross" for a small time).
Code for reposition is in mozilla/layout/xul/base/srcnsMenuPopupFrame.cpp,
method nsMenuPopupFrame::SyncViewWithFrame()
So, my proposal is to rewrite ypos reposition. Now mozilla substract
"(screenViewLocY + mRect.height) - screenBottomTwips" from ypos. It places
bottom of tooltip to "screenBottomTwips" position. My idea is to move
bottom of tooltip up by size of margin.top from y position of event. So,
we need substract "mRect.height + 2 * margin.top" from ypos. margin.top twiced
because we added margin.top to ypos before.
Patch added to attachment. Please review.
But... One more question: should tooltip be "anchored to parent"? Now it's not.
I tested the patch, I think it needs work
for When I open mozilla windows to an large size, not maximized,
and move mouse to the toolbar of left bottom,
the tooltip sometimes shows above tool bar, sometimes shows under the toolbar
it can not reproduce everytimes, but it do appear on my solaris.
Of cause, we need to discuss tooltip policy with module owner.
But nsMenuPopupFrame::SyncViewWithFrame() is correct place for
tooltip position calculations.
Comment 10•23 years ago
|
||
Patch affects two files:
mozilla/layout/xul/base/src/nsMenuPopupFrame.cpp
mozilla/layout/xul/base/src/nsPopupSetFrame.cpp
It turns toolbar's and taskbar's tooltips to 'anchored-to-parent', so they
become to behave almost like Netscape 4.x
Patch does not affect HTML elements tooltips. But it has one problem. Anchored
popups should have margins {0, 0, 0, 0} to work excellent. But tooltip popups
has top margin equal 336 twips (16 pixels) in my case. (We take margins
from mStyleContext).
Does anybody knows how to fix margins for these type of tooltips?
Attachment #67437 -
Attachment is obsolete: true
Comment 11•23 years ago
|
||
Sorry for mistake, 336 twips are 21 pixels (1 pix contain 16 twips).
| Assignee | ||
Comment 12•23 years ago
|
||
I think your first patch is on the right road.
but the question about your patch
is just like my comment #8.
maybe there are some thing wrong when calculating screenViewLocY
| Assignee | ||
Comment 13•23 years ago
|
||
just forget my comments #8, #12
I make a mistake.
ypos is the current ypos of your mouse.
so in my case, when mouse stop at the bottom toolbar, such as mail ,chatzilla.
if mouse point is at the top of that icon, tooltip will show under toolbar,
but if it is at the bottom of that icon, tooltip will show above toolbar.
that is right.
| Assignee | ||
Comment 14•23 years ago
|
||
this patch is same as 67437.
just make for the latest trunk.
| Assignee | ||
Comment 15•23 years ago
|
||
hewitt, can you take a look at this bug?
Component: User Interface Design → XP Toolkit/Widgets: Menus
Comment 16•23 years ago
|
||
Can you give a good explanation of why "2 * margin.top" is the correct number to
use here? I don't want to use it just because it happens to work most of the
time. "margin.top + margin.bottom" would be a little more believable, but I'm
still not clear why the margin is involved here.
| Assignee | ||
Comment 17•23 years ago
|
||
notice
http://lxr.mozilla.org/mozilla/source/layout/xul/base/src/nsMenuPopupFrame.cpp#974
defaultly, tooltip's y = mouseY + margin.top
but when tooltip's Y + mRect.height is bigger than screen, tooltip will show
under screen, so I think at that
time(http://lxr.mozilla.org/mozilla/source/layout/xul/base/src/nsMenuPopupFrame.cpp#1232),
tooltip's Y -= margin.top*2 + mRect.height
as why margin.top involved here, you can see bug 101677
Comment 18•23 years ago
|
||
In that case, why is it margin.top and not (margin.top + margin.bottom)?
| Assignee | ||
Comment 19•23 years ago
|
||
good suggestion, replace margin.top*2 with margin.top + margin.bottom
Comment 20•23 years ago
|
||
Comment on attachment 90943 [details] [diff] [review]
patch 0.2
r=bryner
Attachment #90943 -
Flags: review+
Attachment #88591 -
Attachment is obsolete: true
Attachment #77671 -
Attachment is obsolete: true
Comment 21•23 years ago
|
||
Comment on attachment 90943 [details] [diff] [review]
patch 0.2
sr=hewitt
Attachment #90943 -
Flags: superreview+
Comment 22•23 years ago
|
||
Could we add a comment (better yet, a diagram) explaining what's going on to
that code?
| Assignee | ||
Comment 23•23 years ago
|
||
fix checkin
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Whiteboard: branchOEM+ fixedOEM → branchOEM+
Comment 24•20 years ago
|
||
Note that this patch is wrong for popups that are more than half the screen in
height and caused bug 245163.
I'm also glad to see that my request in comment 22 was disregarded; that led me
to spend an extra couple hours today debugging.
Comment 25•20 years ago
|
||
In fact, this patch is just flat-out wrong. Depending on where the bottom of
the window is, and where the mouse pointer is, you can still get overlap between
the mouse and the tooltip, since we have that random 21-px offset.
Comment 26•20 years ago
|
||
To be more precise, tooltips have a 21px top margin, but have 0 bottom margin...
Comment 27•20 years ago
|
||
(In reply to comment #26)
>To be more precise, tooltips have a 21px top margin, but have 0 bottom margin...
And that's a hack that happens to work because most arrow cursors are 21px tall.
Component: XP Toolkit/Widgets: Menus → XUL
QA Contact: zach → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•