← Back to team overview

nuvola-player-devel team mailing list archive

[Merge] lp:~mpdeimos/nuvola-player/bug-1065602 into lp:nuvola-player

 

mpdeimos has proposed merging lp:~mpdeimos/nuvola-player/bug-1065602 into lp:nuvola-player.

Requested reviews:
  Jiří Janoušek (fenryxo)

For more details, see:
https://code.launchpad.net/~mpdeimos/nuvola-player/bug-1065602/+merge/200248

Implements Bug #1065602:
Mouse back/forward button interaction
-- 
https://code.launchpad.net/~mpdeimos/nuvola-player/bug-1065602/+merge/200248
Your team Nuvola Player Development is subscribed to branch lp:nuvola-player.
=== modified file 'src/nuvola/gui/mainwebview.vala'
--- src/nuvola/gui/mainwebview.vala	2013-08-15 20:08:26 +0000
+++ src/nuvola/gui/mainwebview.vala	2014-01-01 09:11:35 +0000
@@ -103,6 +103,8 @@
 
 		navigation_policy_decision_requested.connect(on_new_page);
 		new_window_policy_decision_requested.connect(on_new_window);
+		
+		button_release_event.connect(on_mouse_button_released);
 	}
 	
 	public override WebKit.WebView create_web_view(WebFrame frame){
@@ -230,6 +232,24 @@
 	}
 	
 	/**
+	 * Handles special mouse buttons (back & forward navigation)
+	 */
+	private bool on_mouse_button_released(Gdk.EventButton button)
+	{
+		switch (button.button)
+		{
+			case 8:  // mouse back button
+				go_back();
+				return true;
+			case 9:  // mouse forward button
+				go_forward();
+				return true;
+			default: // ignore all other buttons
+				return false;
+		}
+	}
+	
+	/**
 	 * Logs debug message with libfenryxo domain // FIXME
 	 * @param format format string
 	 */


Follow ups