Closed Bug 188126 Opened 22 years ago Closed 16 years ago

gtk2: autocomplete/popup widgets should not block clicks outside of themselves

Categories

(Core :: Widget: Gtk, defect)

x86
Linux
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla1.9beta3

People

(Reporter: jruderman, Assigned: kinetik)

References

Details

(Keywords: access)

Attachments

(3 files, 1 obsolete file)

Splitting from bug 66834, which was fixed on Windows but not on gtk. 
gtk-related comments from bug 66834:


------- Additional Comment #65 From Aaron Leventhal  2002-11-04 17:08 -------

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()?


------- Additional Comment #74 From Aaron Leventhal  2002-11-05 19:20 -------

->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.


------- Additional Comment #77 From Aaron Leventhal  2002-11-06 13:41 -------

...

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.


------- Additional Comment #79 From Akkana  2002-11-08 11:56 -------

Blizzard, does gtk2 do this right?  Who owns menus in the gtk/gtk2 widget
library, or has some familiarity with the menu code?


------- Additional Comment #80 From Christopher Blizzard  2002-11-08 13:38 -------

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.


------- Additional Comment #87 From Christopher Blizzard  2002-12-02 21:55 -------

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.


------- Additional Comment #88 From Robin Lu 2002-12-05 19:19 -------

Created an attachment (id=108440)
proposal patch for gtk

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
event. 

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. :)
Patch from bug 66834 comment 88.
*** Bug 301245 has been marked as a duplicate of this bug. ***
Flags: blocking1.8b5?
Flags: blocking1.8b5? → blocking1.8b5-
Just an amendment to a comment blizzard made earlier - Firefox's behaviour is no longer even close to the platform behaviour.
QA Contact: shrir → xptoolkit.widgets
Component: XP Toolkit/Widgets: Menus → Widget: Gtk
QA Contact: xptoolkit.widgets → gtk
Is this patch still needed/wanted?
The patch isn't since the gtk (GTK+ 1.2) port has been removed from the tree, but the bug is still valid for the gtk2 port.
Summary: gtk: autocomplete/popup widgets should not block clicks outside of themselves → gtk2: autocomplete/popup widgets should not block clicks outside of themselves
(In reply to comment #5)
> The patch isn't since the gtk (GTK+ 1.2) port has been removed from the tree,
> but the bug is still valid for the gtk2 port.

Mind updating the patch to current CVS and requesting review then?
I had a brief look just now; the code has completely changed and will require some more investigation, so it's not really possible to update the current patch too quickly.  Someone should figure out what is happening with the gtk2 widget impl.
Attached patch Robin's patch reworked for gtk2 (obsolete) (deleted) — Splinter Review
This seems to work, but it's useless on its own because nsWindow::CaptureRollupEvents is only ever called with aConsumeRollupEvent == PR_TRUE.
I made these changes so that nsWindow::ConsumeRollupEvents would be called with aConsumeEvents == PR_FALSE for the autocomplete dropdown (for both the location bar and the search box).  They might be wrong, but the current code in nsMenuPopupFrame::ConsumeOutsideClicks looks wrong for trunk's browser.xul... somebody who knows this better than me needs to take a look.
> aConsumeEvents == PR_FALSE

I mean aConsumeRollupEvents.
Comment on attachment 296473 [details] [diff] [review]
Robin's patch reworked for gtk2

Requesting r+sr.  Even if callers aren't doing the right thing, we might as well take this code so we do the right thing with the aConsumeRollupEvent parameter of nsWindow::CaptureRollupEvents in the GTK2 widget code.  Then it's just a matter of fixing the callers.
Attachment #296473 - Flags: superreview?(roc)
Attachment #296473 - Flags: review?(roc)
Maybe we can just check whether gRollupListener is null instead of adding a new variable.
nsWindow::CaptureRollupEvents can be passed a rollup listener both when we want to consume rollup events and when we don't (that is, the request to consume rollup events in independent of whether we are passed a rollup listener), so we can't share that variable for this piece of state.
How about just checking "gConsumeRollupEvent && check_for_rollup"...?
Attached patch patch v2 (deleted) — Splinter Review
Yeah, introducing that nested if is a bit dumb.  New patch attached that fixes that, and also takes the precaution of setting gConsumeRollupEvent to PR_FALSE in the aDoCapture == PR_FALSE path of nsWindow::CaptureRollupEvents.

Note that the test has to be |check_for_rollup && gConsumeRollupEvent|, because we must always call check_for_rollup (it has the side effect of causing an existing rollup to roll up).  To make it clearer, I've moved the check_for_rollup call out of the if statement and now save the result of calling it so the test becomes |gConsumeRollupEvent && rolledUp|.
Assignee: iamawalrus → kinetik
Attachment #296473 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #296883 - Flags: superreview?(roc)
Attachment #296883 - Flags: review?(roc)
Attachment #296473 - Flags: superreview?(roc)
Attachment #296473 - Flags: review?(roc)
Attachment #296883 - Flags: superreview?(roc)
Attachment #296883 - Flags: superreview+
Attachment #296883 - Flags: review?(roc)
Attachment #296883 - Flags: review+
Comment on attachment 296883 [details] [diff] [review]
patch v2

Requesting a1.9+.  Low risk change that makes progress towards fixing this bug by adding support to the GTK2 widget code.  Until the appropriate changes are made to nsMenuPopupFrame.cpp, this patch will not affect behaviour.
Attachment #296883 - Flags: approval1.9?
Attachment #296883 - Flags: approval1.9? → approval1.9+
Keywords: checkin-needed
Patch was screwed up... had to manually patch parts of it.

Checking in widget/src/gtk2/nsWindow.cpp;
/cvsroot/mozilla/widget/src/gtk2/nsWindow.cpp,v  <--  nsWindow.cpp
new revision: 1.250; previous revision: 1.249
done
Keywords: checkin-needed
Target Milestone: --- → mozilla1.9 M11
My patch caused bug 412341.
Blocks: 433051
Filed follow up bug 433051 for comment 9.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: