After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660006 - Extra mouse button navigates back, but not in list view of nautilus
Extra mouse button navigates back, but not in list view of nautilus
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Navigation
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 629635 (view as bug list)
Depends on: 673441
Blocks:
 
 
Reported: 2011-09-24 13:12 UTC by Oliver Joos
Modified: 2012-04-12 19:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix forward and backward mouse buttons over icons (1.70 KB, patch)
2011-12-16 12:22 UTC, Nelson Benitez
reviewed Details | Review
Make List view hook to nautilus window handling of forward and backward buttons (3.38 KB, patch)
2011-12-16 13:33 UTC, Nelson Benitez
needs-work Details | Review
Backported to 2.32.2.1: Fix forward and backward mouse buttons over icons (3.58 KB, patch)
2011-12-17 23:22 UTC, Oliver Joos
rejected Details | Review
Backported to 2.32.2.1: Make List view hook to nautilus window handling of forward and backward buttons (1.70 KB, patch)
2011-12-17 23:23 UTC, Oliver Joos
rejected Details | Review
Ignore extra mouse buttons on eel canvas button press/release handler (1.09 KB, patch)
2012-03-29 09:32 UTC, Nelson Benitez
accepted-commit_now Details | Review
Don't handle extra mouse button events on nautilus list view (1.11 KB, patch)
2012-04-03 15:04 UTC, Nelson Benitez
committed Details | Review
Ignore extra mouse buttons on eel canvas button press/release handler (979 bytes, patch)
2012-04-03 15:21 UTC, Nelson Benitez
committed Details | Review

Description Oliver Joos 2011-09-24 13:12:33 UTC
I have a Logitech Cordless Mouse Man Optical, which has one additional "thumb button" on the left side. Gnome does a great job and maps this button by default to navigate "Back", in Nautilus and also in Firefox! "xinput --query-state" shows me this button as ButtonClass "button[8]".

If the pointer is outside the icon frame (e.g. over pathbar or toolbar) then clicking this button always navigates back, independent of the view mode.
But if Nautilus shows List View then clicking this button selects the list row where the pointer is, or does nothing if it is over white space below the list.
And if Nautilus shows Symbol or Compact View then a click on this button navigates "Back", except if the pointer is over an icon, then it does nothing.

Apart from the inconsistent behaviour in different view modes, it would greatly improve usability of an additional mouse button, if Nautilus would always navigate back when clicked, whenever the pointer is within its window. That is what Firefox does! Another detail: Firefox also goes back if this button is clicked over its menubar. In Nautilus' menubar this button acts just like the left mouse button and toggles a menus.
Comment 1 Oliver Joos 2011-10-26 21:44:44 UTC
I just checked Nautilus 3.20. it is also affected by this bug.
Comment 2 Nelson Benitez 2011-12-16 12:22:17 UTC
Created attachment 203658 [details] [review]
Fix forward and backward mouse buttons over icons

(In reply to comment #0)
> And if Nautilus shows Symbol or Compact View then a click on this button
> navigates "Back", except if the pointer is over an icon, then it does nothing.

This patch is for fixing that bug.

I will make another patch to fix list view.
Comment 3 Nelson Benitez 2011-12-16 13:33:16 UTC
Created attachment 203675 [details] [review]
Make List view hook to nautilus window handling of forward and backward buttons

Icon view chains button press up to nautilus_window.c where the forward and backward buttons are handled. On the contrary List view button press event does not propagate to nautilus window as icon view does (I tried but couldn't do it) and so I call the nautilus window callback directly from list view. I do it in two places, one for when over list view rows and other for when over blank space.

So this fixes list view forward and backward mouse buttons as described on bug.
Comment 4 Oliver Joos 2011-12-17 23:20:16 UTC
Great, thank you! I tested your patches. They work exactly as expected.

I also backported them to 2.32.2.1. But I am not experienced in committing to Gnome. Could you please help with this (or tell me who can)? IMHO it would be more effective to apply these patches upstream than to every interested project separately. (I think of MATE, Linux Mint ect.)

And thanks again for your quick and clean implementation!
Comment 5 Oliver Joos 2011-12-17 23:22:44 UTC
Created attachment 203758 [details] [review]
Backported to 2.32.2.1: Fix forward and backward mouse buttons over icons
Comment 6 Oliver Joos 2011-12-17 23:23:21 UTC
Created attachment 203759 [details] [review]
Backported to 2.32.2.1: Make List view hook to nautilus window handling of forward and backward buttons
Comment 7 Cosimo Cecchi 2012-03-28 20:27:35 UTC
Review of attachment 203658 [details] [review]:

Hmm, can't we make the code in EelCanvas ignore such events directly instead?
By looking at the code in eel_canvas_button() is seems we already have checks for button < 6. Maybe we can just ignore the event there in that case.
Comment 8 Cosimo Cecchi 2012-03-28 20:32:03 UTC
Review of attachment 203675 [details] [review]:

I don't like making this public outside of NautilusWindow.
I think you can just avoid handling those events (i.e. return FALSE from the handler), and they will bubble up all the way to the window automatically, no?
Comment 9 Cosimo Cecchi 2012-03-28 20:34:08 UTC
(In reply to comment #4)

> I also backported them to 2.32.2.1. But I am not experienced in committing to
> Gnome. Could you please help with this (or tell me who can)? IMHO it would be
> more effective to apply these patches upstream than to every interested project
> separately. (I think of MATE, Linux Mint ect.)
> 
> And thanks again for your quick and clean implementation!

Hi Oliver; we don't track backporting of patches to old stable versions in bugzilla. When the patches will hit master, please get in touch with a nautilus developer on nautilus-list@gnome.org or in #nautilus on irc.gimpnet.org if you're interested in backporting.
Comment 10 Nelson Benitez 2012-03-29 09:32:46 UTC
Created attachment 210850 [details] [review]
Ignore extra mouse buttons on eel canvas button press/release handler

(In reply to comment #7)
> Review of attachment 203658 [details] [review]:
> 
> Hmm, can't we make the code in EelCanvas ignore such events directly instead?
> By looking at the code in eel_canvas_button() is seems we already have checks
> for button < 6. Maybe we can just ignore the event there in that case.

Ok, I'm attaching new patch for ignoring the extra mouse buttons on eel canvas, it is working fine. 

Regards,
Comment 11 Cosimo Cecchi 2012-03-29 15:08:43 UTC
Review of attachment 210850 [details] [review]:

Thanks, looks good! Just a minor comment below.

::: eel/eel-canvas.c
@@ +2998,1 @@
 		return retval;

Can you either update the comment in the code above, or make the (event->button > 5) a separate if block?
Comment 12 Oliver Joos 2012-03-29 21:32:50 UTC
Hi Nelson!

Your new patch looks really clean. Since I still use Gnome 2 I applied it to nautilus 2.32.2.1. It works as expected for Icon View and Compact View. But in List View Mode the thumb button mentioned in the description of this bug still selects the line under the mouse pointer instead of triggering "Back".

Please tell me if it works for you in List View too! Then I would have to look deeper into differences of Nautilus 2 and 3.
Comment 13 Cosimo Cecchi 2012-03-29 21:42:44 UTC
(In reply to comment #12)

> Please tell me if it works for you in List View too! Then I would have to look
> deeper into differences of Nautilus 2 and 3.

Note that the latest patch by Nelson only covers icon and compact view.
The patch for list view from comment #3 needs to be updated according to the review in comment #8.
Comment 14 Nelson Benitez 2012-03-30 18:14:16 UTC
(In reply to comment #13)
> (In reply to comment #12)
> 
> > Please tell me if it works for you in List View too! Then I would have to look
> > deeper into differences of Nautilus 2 and 3.
> 
> Note that the latest patch by Nelson only covers icon and compact view.
> The patch for list view from comment #3 needs to be updated according to the
> review in comment #8.

Cosimo already explained. The patch for listview seems a bit trickier as it is not bubbling up to NautilusWindow from list view, I am now thinking if it could be that gtktreeview button_press handler is stopping the bubbling up, like this:

NautilusListview handler -> GtkTreeView handler(stopped here) -> NautilusWindow handler

Does this make sense? On monday I will work on verify this and see if it could be the problem..
Comment 15 Nelson Benitez 2012-03-30 18:16:14 UTC
(In reply to comment #11)
> Review of attachment 210850 [details] [review]:
> 
> Thanks, looks good! Just a minor comment below.
> 
> ::: eel/eel-canvas.c
> @@ +2998,1 @@
>          return retval;
> 
> Can you either update the comment in the code above, or make the (event->button
> > 5) a separate if block?

Will do on monday. have a nice weekend.
Comment 16 Nelson Benitez 2012-04-03 15:04:22 UTC
Created attachment 211232 [details] [review]
Don't handle extra mouse button events on nautilus list view

(In reply to comment #13)
> (In reply to comment #12)
> 
> > Please tell me if it works for you in List View too! Then I would have to look
> > deeper into differences of Nautilus 2 and 3.
> 
> Note that the latest patch by Nelson only covers icon and compact view.
> The patch for list view from comment #3 needs to be updated according to the
> review in comment #8.

As I was suspecting, GtkTreeView default button_press handler was blocking the event and not let it reach NautilusWindow, so I've made a patch for that in bug 673441 and marking it as blocking this, and this is the patch for the nautilus list view part.
Comment 17 Cosimo Cecchi 2012-04-03 15:16:47 UTC
Review of attachment 211232 [details] [review]:

Yeah, this looks good to commit once the GtkTreeView patch has been accepted.
Comment 18 Nelson Benitez 2012-04-03 15:21:10 UTC
Created attachment 211233 [details] [review]
Ignore extra mouse buttons on eel canvas button press/release handler

(In reply to comment #11)
> Review of attachment 210850 [details] [review]:
> 
> Thanks, looks good! Just a minor comment below.
> 
> ::: eel/eel-canvas.c
> @@ +2998,1 @@
>          return retval;
> 
> Can you either update the comment in the code above, or make the (event->button
> > 5) a separate if block?

Done. Ok to commit?
Comment 19 Cosimo Cecchi 2012-04-03 15:33:57 UTC
Review of attachment 211233 [details] [review]:

Yes, thanks!
Comment 20 Nelson Benitez 2012-04-04 15:11:55 UTC
Comment on attachment 211232 [details] [review]
Don't handle extra mouse button events on nautilus list view

Committed both patches, thank you.
Comment 21 Oliver Joos 2012-04-11 12:16:51 UTC
Thank you very much to both of you!

Since GtkTreeView is also affected by the new fix, a backport to Gnome 2 is more costly now. Anyway, I will first try to migrate to Gnome 3. I just tried Ubuntu 12.04 beta 2 in "Gnome 3 Classic Mode" (by installing "gnome-panel" from "universe") and it looks promising. I hope your patch(es) will make it into 12.04 LTS.
Comment 22 Cosimo Cecchi 2012-04-12 19:34:54 UTC
*** Bug 629635 has been marked as a duplicate of this bug. ***