From: Ben Pfaff Date: Sun, 28 Oct 2012 20:01:47 +0000 (-0700) Subject: pspp-sheet-view: Make Shift+Tab select only one cell when switching rows. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=811c669032a18cfff53291a98e5803afdf39db36;p=pspp pspp-sheet-view: Make Shift+Tab select only one cell when switching rows. Before this commit, Shift+Tab at the start of a row in the data sheet would select both the new cell and the cell below it. After this commit, only the new cell is selected, as one would expect. Reported by John Darrington. --- diff --git a/src/ui/gui/pspp-sheet-view.c b/src/ui/gui/pspp-sheet-view.c index c06abeb2a6..9dbec5916b 100644 --- a/src/ui/gui/pspp-sheet-view.c +++ b/src/ui/gui/pspp-sheet-view.c @@ -8208,10 +8208,17 @@ pspp_sheet_view_move_cursor_tab (PsppSheetView *tree_view, if (!gtk_widget_has_focus (GTK_WIDGET (tree_view))) return; - if (!try_move_cursor_tab (tree_view, TRUE, count) - && pspp_sheet_view_move_cursor_up_down (tree_view, count) - && !try_move_cursor_tab (tree_view, FALSE, count)) - gtk_widget_error_bell (GTK_WIDGET (tree_view)); + if (!try_move_cursor_tab (tree_view, TRUE, count)) + { + /* Shift+Tab goes backward, but Shift isn't supposed to act as Shift does + for other movement commands, that is, it shouldn't cause the selection + to be extended, so we need to act as though it is off. */ + tree_view->priv->shift_pressed = FALSE; + + if (pspp_sheet_view_move_cursor_up_down (tree_view, count) + && !try_move_cursor_tab (tree_view, FALSE, count)) + gtk_widget_error_bell (GTK_WIDGET (tree_view)); + } pspp_sheet_view_clamp_column_visible (tree_view, tree_view->priv->focus_column, TRUE);