GNOME Bugzilla – Bug 660006
Extra mouse button navigates back, but not in list view of nautilus
Last modified: 2012-04-12 19:34:54 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.
I just checked Nautilus 3.20. it is also affected by this bug.
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.
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.
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!
Created attachment 203758 [details] [review] Backported to 2.32.2.1: Fix forward and backward mouse buttons over icons
Created attachment 203759 [details] [review] Backported to 2.32.2.1: Make List view hook to nautilus window handling of forward and backward buttons
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.
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?
(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.
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,
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?
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.
(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.
(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..
(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.
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.
Review of attachment 211232 [details] [review]: Yeah, this looks good to commit once the GtkTreeView patch has been accepted.
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?
Review of attachment 211233 [details] [review]: Yes, thanks!
Comment on attachment 211232 [details] [review] Don't handle extra mouse button events on nautilus list view Committed both patches, thank you.
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.
*** Bug 629635 has been marked as a duplicate of this bug. ***