GNOME Bugzilla – Bug 787464
Bind back/forward mouse buttons to history navigation
Last modified: 2017-11-27 17:06:30 UTC
Created attachment 359426 [details] [review] Bind back/forward mouse buttons to history navigation It would be handy if the back and forward buttons on multi-button mice could be used to go back or forward in history, similar to the behavior in Nautilus or in web browsers. The attached patch mimics the implementation in Nautilus (https://github.com/GNOME/nautilus/blob/017a90beb6d68788bfffcedcf2b9ba3fa7116ec7/src/nautilus-window.c#L2796).
Review of attachment 359426 [details] [review]: Thanks for the patch, I'm fine with this, but the patch needs some changes. ::: shell/ev-window.c @@ +103,3 @@ +static gboolean mouse_back_button = 8; +static gboolean mouse_forward_button = 9; Why are these gbooleans? I guess they should be unsigned. Or even better use a macro definition MOUSE_BUTTON_BACK, MOUSE_BUTTON_FORWARD, for example. @@ +964,3 @@ + { + handled = FALSE; + } Coding style is wrong here, we don't indent braces. This would look better with a switch. We could return from the case instead of using a local variable and just break in default: @@ +7277,3 @@ + /* Mouse back and forward buttons */ + g_signal_connect (ev_window, "button-press-event", + G_CALLBACK (window_button_press_event), ev_window); I would add an implementation for button_press_event vfunc in class_init instead.
Created attachment 364445 [details] [review] Bind back/forward mouse buttons to history navigation Thanks for the comments. The updated patch incorporates your suggestions.
Comment on attachment 364445 [details] [review] Bind back/forward mouse buttons to history navigation Fixed coding style and pushed, thanks!