r9557 MarkieB - /branches/MarkieB/gtkmain/gtk/gtk_window.c

netsurf at semichrome.net netsurf at semichrome.net
Tue Sep 8 09:19:09 BST 2009


Author: MarkieB
Date: Tue Sep  8 03:19:08 2009
New Revision: 9557

URL: http://source.netsurf-browser.org?rev=9557&view=rev
Log:
tidy up some todo wrt mouse clicks

Modified:
    branches/MarkieB/gtkmain/gtk/gtk_window.c

Modified: branches/MarkieB/gtkmain/gtk/gtk_window.c
URL: http://source.netsurf-browser.org/branches/MarkieB/gtkmain/gtk/gtk_window.c?rev=9557&r1=9556&r2=9557&view=diff
==============================================================================
--- branches/MarkieB/gtkmain/gtk/gtk_window.c (original)
+++ branches/MarkieB/gtkmain/gtk/gtk_window.c Tue Sep  8 03:19:08 2009
@@ -456,25 +456,18 @@
 	g->mouse->pressed_x = event->x / g->bw->scale;
 	g->mouse->pressed_y = event->y / g->bw->scale;
 
-	if (event->button == 3) {
-		/** \todo
-		 * Firstly, MOUSE_PRESS_2 on GTK is a middle click, which doesn't
-		 * appear correct to me.  Secondly, right-clicks are not passed to
-		 * browser_window_mouse_click() at all, which also seems incorrect
-		 * since they should result in browser_window_remove_caret().
-		 *
-		 * I would surmise we need a MOUSE_PRESS_3, unless right-clicking is
-		 * supposed to be mapped to MOUSE_PRESS_2, but that doesn't appear
-		 * correct either.
-		 */
+	switch (event->button) {
+	case 1:
+		g->mouse->state = BROWSER_MOUSE_PRESS_1;
+		break;
+	case 3: 
 		browser_window_remove_caret(g->bw);
-		nsgtk_scaffolding_popup_menu(g->scaffold, g->mouse->pressed_x, g->mouse->pressed_y);
-		return TRUE;
-	}
-
-	switch (event->button) {
-		case 1: g->mouse->state = BROWSER_MOUSE_PRESS_1; break;
-		case 2: g->mouse->state = BROWSER_MOUSE_PRESS_2; break;
+		nsgtk_scaffolding_popup_menu(g->scaffold, g->mouse->pressed_x,
+				g->mouse->pressed_y);
+		g->mouse->state = BROWSER_MOUSE_PRESS_2;
+		break;
+	default:
+		return FALSE;
 	}
 	/* Handle the modifiers too */
 	if (event->state & GDK_SHIFT_MASK)




More information about the netsurf-commits mailing list