Closed Bug 66834 Opened 21 years ago Closed 1 year ago

autocomplete/popup widgets should not block clicks outside of themselves


(Core :: XUL, defect, P5)






(Reporter: jruderman, Unassigned)


(Blocks 1 open bug)


(Keywords: access, helpwanted, Whiteboard: [adt3][Hixie-P0] fixed:os/2 ?:win32,mac broke:unix)


(3 files, 1 obsolete file)

Steps to reproduce:
1. Open Mozilla.
2. Chop off the last part of the url you're at and wait a few seconds.
   (This should make the location bar drop-down appear.)
3. Click or start a drag in the content area or in the location bar.

Result: the drop-down goes away, but nothing else happens.  This is annoying 
when trying to focus the page for scrolling and when trying to move the 
insertion point within the location bar.

Expected result: my click (or start of drag) should succeed and the drop-down 
should go away.
this is an xptoolkit bug, issues with popups
Assignee: alecf → pinkerton
Component: History: URLBar → XP Toolkit/Widgets: Menus
QA Contact: claudius → jrgm
hrm. right now, all popups/menus/tooltips eat the click by design. I guess we
need a mechanism to specify to the widget code not to eat the click. I notice
that gRollupListener implements nsIMenuRollup so perhaps we could stick
something on that.

cc'ing hyatt just for fun.
Target Milestone: --- → mozilla0.9
Target Milestone: mozilla0.9 → mozilla1.0
*** Bug 82494 has been marked as a duplicate of this bug. ***
also see bug 21390, marked INVALID
I like the idea of specific widgets indicating that they don't want to eat the
Yah, this is a duplicate of bug 21390, which I think really should be fixed. In 
that bug you can see Mac users wanting a click outside a popup just to cancel 
the popup, and Windows/Linux users wanting a click outside a popup to activate 
the item under the cursor. Why? Because that's how other apps on their 
respective OSes usually behave. The same applies to this particular popup -- I 
think allowing the behavior to be inconsistent between popups would be rather 
*** Bug 82173 has been marked as a duplicate of this bug. ***
The location bar drop-down should not eat clicks outside of itself on any 
platform.  See bug 82494, takes two clicks to use the search button next to the 
location bar.

Also, I think an autocomplete drop-down is conceptually different from other 
drop-downs or menus, because the user explicitly activates the menus but not 
autocomplete drop-downs.  Let's keep this separate from bug 21390.
*** Bug 84388 has been marked as a duplicate of this bug. ***
*** Bug 84924 has been marked as a duplicate of this bug. ***
*** Bug 79303 has been marked as a duplicate of this bug. ***
thx to jesse for pointing this out to me. methinks i'm running into this all
platforms. here's my testcase --but let me know if anyone else thinks this is a
different bug [perhaps bug 82787?].

1. click in the URLbar.
2. if you hit pageDown, pageUp, or spacebar, this will trigger the URLbar
history droplist [expected].
3. click in the content area of browser window --the URLbar droplist goes away
as expected, but...
4. try to scroll in the browser window using the keyboard [pageDown, PageUp,
spacebar, arrow keys...].

result: unable to scroll. instead, the URLbar droplist drops down.

workaround: need to doubleclick or click twice in the content area to make
scrolling via keyboard work again. a singleclick doesn't seem to suffice.
Keywords: access
OS: Windows 98 → All
Hardware: PC → All
*** Bug 87751 has been marked as a duplicate of this bug. ***
See also bug 86643, Autocomplete dropdown is included in the tab order.
Keywords: nsCatFood
*** Bug 91901 has been marked as a duplicate of this bug. ***
Component: XP Toolkit/Widgets: Menus → XP Apps: Autocomplete
Summary: location bar drop-down should not block clicks outside of itself → autocomplete widget should not block clicks outside of itself
This issue has been the main bug driving me to use browsers other than Mozilla
in the last few months.  It takes two clicks to transfer keyboard focus to other
apps, and sometimes I have to click three or four times in the mozilla content
area just to get focus out of the urlbar so that page up/down keys will work.
clicking to other apps shouldn't be affected by this bug (if we eat clicks to 
other apps, that's a different bug). also, if you have to click 3-4 times, that 
too is a different bug with key focus setting. i've never seen either of these 
Clicking to other apps is affected because the dropdown is grabbing the mouse
focus, so the first click anywhere on the screen just dismisses the dropdown and
isn't passed through.  (You can tell because the cursor changes when the
dropdown is displayed, and doesn't change when you leave the mozilla window as
it should.) Presumably it does something different on Mac, but this is what it
does on Linux (both kde and gnome) with pointer focus.
*** Bug 94012 has been marked as a duplicate of this bug. ***
The first click anywhere on the screen dismisses the dropdown and
*is* passed through for me on Win2k 20010806 and WinME 20010805.
Definitely not passed through for me on Linux, using either kde or gnome/sawfish
and pointer focus.
It's not passed through on WinNT 4 either.
*** Bug 103725 has been marked as a duplicate of this bug. ***
*** Bug 95237 has been marked as a duplicate of this bug. ***
Target Milestone: mozilla1.0 → mozilla0.9.9
*** Bug 103815 has been marked as a duplicate of this bug. ***
*** Bug 106799 has been marked as a duplicate of this bug. ***
*** Bug 109095 has been marked as a duplicate of this bug. ***
not going to get to it -> toolkit
Assignee: pinkerton → hyatt
Component: XP Apps: Autocomplete → XP Toolkit/Widgets: Menus
Target Milestone: mozilla0.9.9 → ---
Target Milestone: --- → mozilla1.1
*** Bug 105744 has been marked as a duplicate of this bug. ***
*** Bug 118731 has been marked as a duplicate of this bug. ***
Whiteboard: [Hixie-P0]
nsbeta1+ per Nav triage team
Keywords: nsbeta1nsbeta1+
Mass move of nsbeta1+ bugs that didn't have a valid MachV milestone to mozilla1.0.
Target Milestone: mozilla1.1 → mozilla1.0
Whiteboard: [Hixie-P0] → [Hixie-P0][adt3]
Blocks: atfmeta
*** Bug 135132 has been marked as a duplicate of this bug. ***
A stroodle in your noodle: This issue affects focus on mouse and comment 16.
Basically I have my window manager set up so that if I move my mouse pointer
over a window, it activates it. Mozilla's autocomplete dropdown prevents this
from happening requiring that I actually click in the window in order to get focus.

This I find annoying. Mozilla should not be preventing my window manger from
doing it's job properly as per it's configuration. It seems the widget is eating
way to many events in a nasty way and as such is preventing Mozilla playing nice
with my window manager.

This may be Linux only but Windows has a similar feature with TweakUI I believe.
I just don't know if it affects things under Windows.
TweakUI's X-Mouse works properly for me in Win2K.
*** Bug 131135 has been marked as a duplicate of this bug. ***
This was a problem when the clear url button was introduced (not there anymore).
If you wanted to clear the URL with the drop-down open, you'd have to click
twice  on the X to clear it. Once to close the autocomplete widget and one to
actually clear the URL.
nsbeta1- per Nav triage team
Keywords: nsbeta1+nsbeta1-
Whiteboard: [Hixie-P0][adt3] → [Hixie-P0]
Target Milestone: mozilla1.0 → mozilla1.1beta
In response to Comment #19, the click is *not* passed through on Windows XP Pro 
either (Moz 0.9.9).
*** Bug 139960 has been marked as a duplicate of this bug. ***
Mass removing self from CC list.
Now I feel sumb because I have to add back. Sorry for the spam.
*** Bug 147471 has been marked as a duplicate of this bug. ***
*** Bug 156412 has been marked as a duplicate of this bug. ***
*** Bug 130810 has been marked as a duplicate of this bug. ***
*** Bug 152660 has been marked as a duplicate of this bug. ***
Blocks: 158464
This is a serious usability issue.

-> Trudelle, for retriage.
Assignee: hyatt → trudelle
Keywords: nsbeta1-nsbeta1
This appears to be a general problem with any popup menu. Once one is open, any
click outside of it is swallowed, and will only cancel the current menu.
->varga, helpwanted in case navtriage minuses it again.
Assignee: trudelle → varga
Keywords: helpwanted
Nav triage team: nsbeta1+/adt3
Keywords: nsbeta1nsbeta1+
Whiteboard: [Hixie-P0] → [Hixie-P0][adt3]
*** Bug 176678 has been marked as a duplicate of this bug. ***
*** Bug 157878 has been marked as a duplicate of this bug. ***
*** Bug 160518 has been marked as a duplicate of this bug. ***
*** Bug 157336 has been marked as a duplicate of this bug. ***
Keywords: mozilla1.3
Summary: autocomplete widget should not block clicks outside of itself → autocomplete/popup widgets should not block clicks outside of themselves
I have a fix for this.
Assignee: varga → aaronl
Attached patch No brainer fix (obsolete) — Splinter Review
This has been like this for a long time. Apparently popups eat any mouse events
that are outside of them. When certain events happen, the popup gets rolled up,
but the event gets eaten.

Blake came along while back and fixed it so that right clicks outside the popup
could make it through. Now with this patch left clicks and middle clicks
outside the popup don't get eaten.

I'm not sure which of these events really need to get eaten by popups, if any -
should we be letting more of these through? (WM_ACTIVATE, WM_NCLBUTTONDOWN,

Seeking r=
*** Bug 82787 has been marked as a duplicate of this bug. ***
Severity: normal → major
Priority: -- → P1
Target Milestone: mozilla1.1beta → mozilla1.2final
Comment on attachment 105063 [details] [diff] [review]
No brainer fix

this will break menus. you do not want the click processed when you click
outside a menu.
Attachment #105063 - Flags: needs-work+
Pinkerton, can you be more specific?

I open IE, pull down the file menu and click on a link and it works there.

What exactly about processing the click outside the menus will break menus?
Looks like Win32 eats clicks for menulists/selects, but doesn't eat clicks for 
menus (context/menu bar/etc.).

Mac eats clicks for all of these.

Can anyone say what GTK does?  We're going to need some #ifdefs in the menu 
dismissal listener code to get this right I think.
Another idea (to avoid #ifdefs) would be to make the boolean parameter 
represent a widget type instead of a consume flag.  Then the various widget 
implementations could say e.g., "Oh, it's a menulist, I can decide what I 
should do with that."
Here's the chart that I intend to follow:

Eat clicks that occur outside of menu (rollup popup only)?

       Menus     Autocomplete     Comboboxes
Mac     Eat           No              Eat
Win     No            No              Eat     
Unix    Eat           No              Eat
Comment on attachment 105135 [details] [diff] [review]
New better fix -- does correct thing for each widget on each platform

Aren't there two places in the menu dismissal listener file that call
CaptureRollupEvents? Do you want to patch both?  

Attachment #105135 - Flags: superreview+
Comment on attachment 105135 [details] [diff] [review]
New better fix -- does correct thing for each widget on each platform

Sigh, this patch doesn't help with gtk -- we might need to file a separate bug
for that. In widget/src/gtk/nsWindow.cpp, it doesn't look like we do anything with
the aConsumeRollupEvent parameter in CaptureRollupEvents().

Are the events getting swallowed by  
nsWindow::OnButtonPressSignal(GdkEventButton *aGdkButtonEvent)

Perhaps that method needs to pay attention to a member variable set by the
aConsumeRollupEvent parameter in CaptureRollupEvents()?
in IE on win2k, clicking outside a menu eats the click. this is different from
what your patch does.
Pinkerton, Hyatt and I both got the same results.

Pull down the file menu in IE, and then try clicking a link or in the URL bar.
Or, open notepad, pull down the file menu and click in the text.
i was on crack. ignore me.
Comment on attachment 105135 [details] [diff] [review]
New better fix -- does correct thing for each widget on each platform


i really don't care for the name (GetConsumeOutsideClicks). There's no setter,
and other routines in the api that are PRBool "getters" don't have this naming
semantic (IsMenuBar() is an example). How about just "ConsumeOutsideClicks"?
Attachment #105135 - Flags: review+
Okay done.
Clicks outside of menus are not eaten on WinXP. I tried in both IE and Notepad.
Mentioned in several of the bugs duped to this one, but not here: a big part of
the problem at least on unix, which the patch doesn't fix, is that the grab is
systemwide: you can't click in any other app either as long as the mozilla app
has a menu up.
Windows fix checked in, leaving open for other platforms.
->Akkana, for widget/src/gtk fixes

widget/src/gtk/OnButtonPressSignal should not always return early if
gRollupWidget is true. 

We need to remove the extra return statement and let it fall through to the last
statement, if a variable like gCaptureClicksOutsidePopup is set. We need to
invent that variable and set it from the nsWindow::CaptureRollupEvents()
method's last parameter. Then we can avoid the early return here if that's false.

Assignee: aaronl → akkana
Patch to make OS/2 follow the windows route.
I am a little confused.  The patch here seems to disable consuming clicks for
menus, but doesn't seem to address the autocomplete issue.  Has it been decided
to keep the current behaviour for the autocomplete menu?
Eat clicks that occur outside of menu (rollup popup only)?

       Menus     Autocomplete     Comboboxes
Mac     Eat           No              Eat
Win     No            No              Eat     
Unix    Eat           No              Eat

The Windows specific behavior was for menus only.

For autocomplete, the patch makes us call nsIWidget::CaptureRollupEvents(blah,
blah, PR_FALSE) on all platforms. However, we still need platform specific
patches to make sure we use the last parameter in CaptureRollupEvents(), for
determining whether to eat clicks or not.

Believe it or not, clicks in the Mozilla window are always supposed to be eaten
when a combobox is pulled down (they just roll the combobox up).

However, there's yet another problem in gtk where clicks outside the Mozilla
window are even getting eaten, when a combobox is pulled down.
Is there anyone from the Sun team who can take this bug from Akkana? The
explanations I give at the end should give you a head start.
Blizzard, does gtk2 do this right?  Who owns menus in the gtk/gtk2 widget
library, or has some familiarity with the menu code?
This is easy to fix.  Don't make the autocomplete widget grab the pointer or the
keyboard.  Make it pop down on a focus out event.
I see a problem with the w32 solution that was checked in:
I can't dismiss a menu by clicking on the menu item once the menu has dropped down.

1. Single click on the Edit menuitem.
2. Wait a short amount of time (1s or so? It's hard to tell).
3. Single click on the Edit menuitem.

Actual Results:
Menu does not roll up; it stays visible and usable.

Expected Results:
Menu rolls up.

If you do not wait long between clicks, the menu dismisses ->  double clicking
the menu item effectively rolls the menu back up.
I can duplicate the behavior in comment 81 on win32 Windows Millenium build
Yes, how annoying -- please file a spinnoff bug for that specific issue.
Ah, I see someone already filed it as bug 179567.
*** Bug 179652 has been marked as a duplicate of this bug. ***
Target Milestone: mozilla1.2final → ---
Sending this back to widgets where it belongs.  If someone wants to tell me what
widget implements this and does the grab, I'll be happy to code up a patch
making it not do that, but it really ought to be done by someone familiar with
the code and why we're doing it the current way.
Assignee: akkana → hyatt
QA Contact: jrgm → shrir
I, for one, would love to see autocomplete not grab at all.  This is something
that has been asked for by lots of people that I talk to.  I don't really like
it either.

That being said, we need to emulate platform behaviour as closely as possible. 
With gtk/gtk2 popups and dropdowns always eat the mouse event and are popped
down.  As near as I can tell we're pretty close to platform behaviour, at least
with that particular platform.
This patch will enable gtk aware the aConsumeEvent. I did not touch the grab
code because I think it's more like just because the check_roll_up eats the

However, only with this patch the problem could not be sovled, at least in my
gtk mozilla, because the aConsumeEvent being sent to me is always TRUE. I found
the parentTag of the autocomplete in my mozilla is 'popupset' instead of
'textbox'. Could anyone explain it to me?

Blizzard, I don't mean to break the platform routing. I just provide a choice
here. :)
Is it just me or do context menus on Windows still eat clicks?
(What I see on win2k). Context menus eat clicks in mozilla/xul. However, 
context menus do not eat clicks in File Explorer, Nav4.x and IE6.
Aaron, did this patch not also address context menus?
I forgot to test context menus, but we should open a separate bug on them.
Filed bug 187575 for context menus.

(Re: comment 66, you may have been looking at the Favorites menu in IE6.  That
menu blocks clicks but no other menu does.)
This is also a problem for autocomplete in the content area in Phoenix.  For
example, if I type something into the search box at,
clicking on the Search button makes the autocomplete dropdown go away but
doesn't submit the search.
Comment 73 says this is fixed on Windows, but jesus_X and I still see this bug
on Windows XP.  That might be related to why a regression from this patch (bug
187631, "Menus not clearing when cursor is off menu focus") happens on XP but
not other versions of Windows...
Jesse: Bug 187631 does happen for me on Win2K.  See bug 179567 comment 26.
Jesse, how do I test forms autocomplete in Mozilla? I need to know what the XUL
looks like for the autocomplete popup.
To test form autocomplete, I guess you would build Phoenix.
Now this WFM on Windows XP (with Mozilla url bar autocomplete).  Maybe the fix
for bug 187575 fixed this on XP, or fixed a regression on all Windows platforms.
 Either way, it works now :)
Marking this bug as fixed.  I moved the gtk patch to bug 188126.  Was the OS/2
patch checked in, or does that also need its own bug?
Closed: 19 years ago
Resolution: --- → FIXED
Reopening: this bug is platform ALL, and being suddenly wfm on win xp isn't
enough to mark it fixed on all platforms.
Resolution: FIXED → ---
Suddenly works for me on 2003010708 Win32 Millenium.
Nope, noone checked in the OS/2 piece. I'll do it when the tree opens.
Yeah, not believing till I see, this is now ok on Win32. Interesting...
Current behaviour on win98 latest nightly:

file menus no longer eat clicks
right-click menus no longer eat clicks
URL bar dropdown no longer eats clicks
personal toolbar folders (eg. bookmark menu) still eat clicks
toolbar dropdowns (eg. back/forward history) still eat clicks (see bug 65279)

Context menus in MailNews still eat clicks.
Mentioned in several of the duplicates: You still have to click the "Go" button
twice after writing an URL.
-> Jag
Assignee: hyatt → jaggernaut
Whiteboard: [Hixie-P0][adt3] → [adt3][Hixie-P0]
Target Milestone: --- → mozilla1.4beta
R.K.Aa: on what platform are you seeing this? I'm guessing Mac or Linux.
Rkaa is a Linux user.
Now fixed for OS/2 (mkaply's checkin earlier today).
*** Bug 227233 has been marked as a duplicate of this bug. ***
Flags: blocking1.8a6?
Target Milestone: mozilla1.4beta → ---
Flags: blocking1.8a6? → blocking1.8a6-
Flags: blocking1.8b?
Flags: blocking1.8b? → blocking1.8b-
Flags: blocking1.8b2?
Flags: blocking-aviary1.1?
Flags: blocking1.8b2? → blocking1.8b2-
Flags: blocking-aviary1.1? → blocking1.8b3?
Flags: blocking1.8b3? → blocking1.8b4?
Flags: blocking1.8b-
Flags: blocking1.8a6-
Flags: blocking1.8b4? → blocking1.8b4-
is whiteboard accurate status of the platforms? 
Whiteboard: [adt3][Hixie-P0] → [adt3][Hixie-P0] fixed:os/2 ?:win32,mac broke:unix
*** Bug 342628 has been marked as a duplicate of this bug. ***
Here's another example, originally filed as Bug #342628:

Consider the following situation:

My Personal Toolbar is a collection of Folders, not individual Links. So, when
I click on one, I get a drop-down menu. At that point, if I click on *any*
other control (even the "X" control in the upper right corner that should close
the window, or another Personal Toolbar Folder) it simply negates the drop-down
list instead of acting on the other control.

Jim H. (aka CuriousJ)
(In reply to comment #57)
> (From update of attachment 105063 [details] [diff] [review] [edit])
> this will break menus. you do not want the click processed when you click
> outside a menu.

Why not? Dammit, when I click *anywhere* whether it's on a control or not, I
want that click to *do* *what* *I* *intended* *it* *to* *do*! Either I clicked
on a control, which means I wanted to activate that control, or I just clicked
at a random spot on the screen - which, if I were in a menu, means I wanted
*out* of that menu.

Jim H. (aka CuriousJ)
"But when we looked at people actually trying to use the product, they didn't 'aim' their 'dismiss the menu' click at all.  They weren't actually trying to both make the gallery go away and also perform some action with a single click.  Clicking away from the gallery was just an efficient and discoverable way of making it disappear..." -- A Microsoft Office PM on how they went to great lengths to make clicking outside a menu do nothing except close the menu.
I don't think this is a straightforward issue by any means.  I would like to point out that web pages, for the most part, have tons of blank space (that is, space where clicking doesn't do anything).  Compare this to office, where clicking most anywhere on the document would change your caret position or selected cell if the click were not consumed in dismissing the menu.  

I believe that if this bug were "fixed" clicking on blank space would still be a mostly viable means of dismissing the menu.  Furthermore, the user can be sure that their click will be in "dead space" via the feedback mechanism of the mouse cursor appearance.  Whether this is good enough, I can't say.
Component: XP Toolkit/Widgets: Menus → XUL
QA Contact: shrir → xptoolkit.widgets
Assignee: jag → nobody
Decreasing the priority as no update for the last 2 years on this bug.
about the priority meaning.
Priority: P1 → P5

Mass-removing myself from cc; search for 12b9dfe4-ece3-40dc-8d23-60e179f64ac1 or any reasonable part thereof, to mass-delete these notifications (and sorry!)

This seems to be fixed. I've tested the steps to reproduce in comment zero and it behaves as expected.

Closed: 19 years ago1 year ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.