Closed Bug 360731 Opened 18 years ago Closed 18 years ago

Back and Forward buttons on mouse no longer work

Categories

(Core :: General, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: RyanVM, Assigned: smaug)

References

Details

(Keywords: regression)

Attachments

(6 files, 3 obsolete files)

After updating from the 11-13-2006 to the 11-14-2006 trunk build, the back and forward buttons no longer work on my Logitech MX1000 mouse. I got confirmation over at Mozillazine from others with other brands as well. I'll try to narrow down an hourly regression window.
I see this as well with today's build, using a Microsoft Internet Explorer optical 5 button mouse. Forward/back buttons have not response, and I see nothing in the JS Console to indicate any errors. Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061114 Minefield/3.0a1 Firefox ID:2006111405 [cairo]
I see this as well on my Logitech MX 510 Optical Mouse.
Keywords: regression
Confirmed on Windows Vista RC2 with the Microsoft Trackball Optical.
Same problem on XP Pro SP2 with a generic 5 button mouse.
The checkins in the regression range in comment 0 are: http://bonsai.mozilla.org/cvsquery.cgi?module=PhoenixTinderbox&branch=HEAD&branchtype=match&date=explicit&mindate=2006-11-13+02%3A00&maxdate=2006-11-14+06%3A00 I don't see anything in that list that looks like it would have caused this, at first glance. Have the people who can reproduce this tried reproducing it in safe mode? With a new profile? Would it be possible to get a narrower regression range? Does it work in SeaMonkey? If not, does it have the same regression range?
Still happens in safe mode with a new profile.
I too have tried Safe-mode, and a new profile - no change. I just installed the latest reflow-build and the back/forward work as they should. Don't know if that's any help really ... Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061115 Minefield/3.0a1 Firefox ID:2006111504
(In reply to comment #5) > Does it work in SeaMonkey? If not, does it have the same regression range? The mouse buttons work fine on SeaMonkey 2006-11-13-09, but fail on SeaMonkey 2006-11-14-09. I don't use SeaMonkey on a regular basis, so these are both fresh installs with new profiles.
Product: Firefox → Core
QA Contact: general → general
The only thing that I see that remotely deals with this is Ere's patch for bug 311709. Any ideas, Ere?
I just went back and did a bunch of cvs checkouts from various times over that date range. As best I can tell, it's roc's patch for bug 130078 which broke it.
Depends on: 130078
I have to leave now, but I'll try reverting the four updated files tonight on the current trunk to confirm that finding.
Blocks: 130078
No longer depends on: 130078
That seems likely. But how to test this?
If you have an idea of what's wrong, I'd be happy to test any patches you want on my system since I can reproduce it.
I don't know how those buttons are supposed to work, do you Ere?
I think they are just virtual key codes on Windows (VK_BROWSER_BACK and VK_BROWSER_FORWARD). Just realized I should be able to emulate them and I might even have a suitable mouse somewhere at home.
I just noticed that the navigation keys around cursor keys on my laptop send VK_BROWSER_BACK/FORWARD but they work properly. So I guess the Logitech mouse is doing something else.
(In reply to comment #16) > So I guess the Logitech mouse is doing something else. I did some quick tests, and it seems that these buttons are generating WM_XBUTTONDOWN messages. See http://msdn2.microsoft.com/en-us/library/ms646245.aspx for more info.
Also, comment #3 pointed out that it affects MS mice too.
Sorry for the bugspam, but I think Ere is right about WM_APPCOMMAND. I just noticed that my MS Natural Keyboard Pro's Back and Forward buttons also don't work. So Ere, if you can get ahold of a keyboard which has back/forward buttons (many do these days), that may work as well.
Nah, I hacked together an app to emulate the buttons. Perhaps I messed up something as sending NS_APPCOMMAND message to foreground window makes it go to nsWebShellWindow, which doesn't handle NS_APPCOMMAND at all. nsEventStateManager would, but doesn't get a chance. I wonder how the MS keyboard driver chooses the window.
Perhaps GetGUIThreadInfo will do the trick.
Ok, here's the deal: the whole process starts at nsWindow.cpp where DispatchAppCommandEvent() is called and ends up in chrome's event state manager. Chrome of course doesn't have history and can't go back. I think this would also affect reload and stop (someone mentioned earlier that it's now possible to reload chrome which kind of breaks everything).
Blocks: 330938
Ok, here's the plan after a quick chat: all the events are dispatched from widget layer as nsAppCommandEvents (including VK_BROWSER...). Then they are directed to chrome and handled there in a way that makes sense for the app.
Here is a possible patch for the Windows widget layer. Can't be tested before the underlying changes are done.
Of course the virtual keys must be handled in OnKeyUp too..
Attachment #245882 - Attachment is obsolete: true
Assignee: nobody → Olli.Pettay
Here is a Lazarus/Free Pascal source for the simple utility I created for testing the special buttons for reference if nothing else. To use just click a button and focus the window you want to receive the app command message.
I think I'll remove nsAppCommandEvent and convert .appCommands to real events which can then be handled in chrome. The handling of those commands could be removed from ESM, I think. In the case of several <browser>s it would be up to the chrome code to decide which one has the focus, or something.
*** Bug 361238 has been marked as a duplicate of this bug. ***
Ere, could you test/look at the Windows part. It includes your patch.
Attachment #246224 - Flags: review?
Attachment #246224 - Flags: review? → review?(emaijala)
(In reply to comment #31) > Ere, could you test/look at the Windows part. > It includes your patch. > Because I haven't even compiled it on windows ;) Using Linux and the test I attached, things seem to work ok.
Olli - your patch fails to compile quite spectacularly on nsWindow.cpp line 1166. I'm assuming you meant "AssignLiteral" and not "AssingLiteral" ;-). I'm doing a test build with that typo corrected now to see if it compiles and fixes the bug.
OK, I have good news and I have bad news. The Good: With the typo fixed, it compiles :-). Also, hitting the refresh button my keyboard no longer results in an empty browser window (in other words, 330938 appears to be fixed by it). The Bad: The Back/Forward buttons on both my keyboard and mouse still don't work. I'm going out of town for the Thanksgiving holiday until Sunday the 26th, so I won't be able to test any further patches until I get back.
(In reply to comment #33) > Olli - your patch fails to compile quite spectacularly on nsWindow.cpp line > 1166. I'm assuming you meant "AssignLiteral" and not "AssingLiteral" ;-). Copy-pasting a typo isn't always a good idea :) Thanks for testing.
Attachment #246224 - Flags: review?(emaijala)
(In reply to comment #23) > Ok, here's the deal: the whole process starts at nsWindow.cpp where > DispatchAppCommandEvent() is called and ends up in chrome's event state > manager. So which ESM is this? Document->GetShellAt(XXX)->PresContext()->EventStateManager(), where Document is the chrome document ? Hmm, I wonder if presShell->GetCurrentEventFrame() is null... Well, anyway, need to hack something so that I can test this using Linux too.
I this still a problem now that Bug 130078 is backed out? I'll anyway do a patch for this, so that 'back', 'forward' etc commands can be handled in chrome.
Attached patch better patch, may even compile (obsolete) — Splinter Review
Feel free to test ;)
Attachment #246224 - Attachment is obsolete: true
The immediate bug is fixed, but we still need this.
Comment on attachment 246369 [details] [diff] [review] better patch, may even compile Ere, want to try this and check the windows part of the code?
Attachment #246369 - Flags: review?(emaijala)
the foward and back buttons are working on a microsoft desktop elite optical bluetooth set!
Comment on attachment 246369 [details] [diff] [review] better patch, may even compile Yes, looks good and the Windows part seems fine. r=emaijala for Windows part. One thing is a bit unclear to me: are these now just "command" events or "appcommand" events? You changed the Windows part to be just command, but the UI part is using appcommand.
Attachment #246369 - Flags: review?(emaijala) → review+
The 'event class' is nsCommandEvent, type of the event is "AppCommand". Later there might be some other types too, for example "AudioCommand", where .command could be then "Play", "Stop" etc.
Comment on attachment 246369 [details] [diff] [review] better patch, may even compile Roc, what do you think about this?
Attachment #246369 - Flags: superreview?(roc)
Why not make nsCommandEvent::command an nsIAtom*? This exposes a new DOM API, and one that's actually accessible to Web authors, right? Is there a way we can make sure it's not visible to Web authors?
(In reply to comment #45) > Why not make nsCommandEvent::command an nsIAtom*? Perhaps better, yes. > > This exposes a new DOM API, and one that's actually accessible to Web authors, > right? Is there a way we can make sure it's not visible to Web authors? > Why shouldn't it be visible to web authors. Chrome handles only trusted events which web content can't dispatch. And if .stopPropagation is used during capture phase in chrome window, the event doesn't propagate anywhere else.
Olli, I'll try patch 246369 on my local tree with 130078 still applied to it to make sure that this bug is truly fixed for when that gets checked into the trunk again after 1.9a1 ships once I get home again on Sunday.
> Why shouldn't it be visible to web authors. No particular reason except that it's a unilateral extension to the DOM API which we aren't marking as experimental.
Well, we have also for example nsIDOMPopupBlockedEvent. Perhaps we should add @unfrozen or something to those interfaces.
> Well, we have also for example nsIDOMPopupBlockedEvent. True. > Perhaps we should add @unfrozen or something to those interfaces. That wouldn't help. Let's go ahead with the nsIAtom* change.
Attachment #246369 - Attachment is obsolete: true
Attachment #246468 - Flags: superreview?(roc)
Attachment #246369 - Flags: superreview?(roc)
Great news, Olli! Attachment 246468 [details] [diff] works beautifully on my tree with 130078 still applied to it :) Assuming it passes review, I think you've got a winner.
Attachment #246468 - Flags: superreview?(roc) → superreview+
Attached patch or this oneSplinter Review
Will file a bug that WINNT 5.2 tb-win32-tbox Depend uses winver 0x400.
Depends on: 362478
Surely this will lead to confusion with ns[IDOM]XULCommandEvent?
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whoops, sorry about that (and the bugspam). Probably shouldn't have resolved the bug when there's still unresolved issues in it :) BTW, the original bug is verified fixed. Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061201 Firefox/3.0a1
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → NEW
Comment on attachment 246468 [details] [diff] [review] using nsIAtom as command >Index: browser/base/content/browser.js >+function HandleAppCommandEvent(evt) >+ switch (evt.command) { >+ case "Reload": >+ BrowserReloadSkipCache(); Why BrowserReloadSkipCache() instead of BrowserReload()?
Status: NEW → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
Any plans on backporting this to Firefox 2.0? I can handly wait to make Firefox my default browser, but this is a show stopper.
This bug was for a regression which only occurred on trunk (Minefield, 3.0 alpha) builds. If you're having issues with back/forward on a 2.0 build, please file a new bug for it.
(In reply to comment #60) > This bug was for a regression which only occurred on trunk (Minefield, 3.0 > alpha) builds. If you're having issues with back/forward on a 2.0 build, please > file a new bug for it. Actually, bug #230717 refers this bug, claiming it would fix the problem of the Web/Home key not working properly (in 1.5 or 2.0). So what does this mean? Is bug #230717 not fixed by this issue? Or will I have to wait for 3.0?
Seems to me that bug 230717 comment #10 makes it pretty clear that it's trunk only. https://bugzilla.mozilla.org/show_bug.cgi?id=230717#c10 Smaug, is this bug at all feasible for some sort of Gecko 1.8.1 landing?
The fix for this bug was non-trivial and added new features etc, and bug 230717 is not critical, so I doubt there are any chances to get this to branch.
Depends on: 425575
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: