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 787464 - Bind back/forward mouse buttons to history navigation
Bind back/forward mouse buttons to history navigation
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
3.25.x
Other Linux
: Normal enhancement
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-09-09 04:37 UTC by Casey Jao
Modified: 2017-11-27 17:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Bind back/forward mouse buttons to history navigation (1.70 KB, patch)
2017-09-09 04:37 UTC, Casey Jao
none Details | Review
Bind back/forward mouse buttons to history navigation (1.68 KB, patch)
2017-11-26 19:17 UTC, Casey Jao
committed Details | Review

Description Casey Jao 2017-09-09 04:37:37 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).
Comment 1 Carlos Garcia Campos 2017-11-18 07:55:41 UTC
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.
Comment 2 Casey Jao 2017-11-26 19:17:58 UTC
Created attachment 364445 [details] [review]
Bind back/forward mouse buttons to history navigation

Thanks for the comments. The updated patch incorporates your suggestions.
Comment 3 Carlos Garcia Campos 2017-11-27 17:06:22 UTC
Comment on attachment 364445 [details] [review]
Bind back/forward mouse buttons to history navigation

Fixed coding style and pushed, thanks!