summaryrefslogtreecommitdiff
path: root/src/file-manager/fm-list-view.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2017-11-04 03:48:05 +0100
committerraveit65 <[email protected]>2017-11-13 10:38:06 +0100
commit188233e09c64f73238d165e90c72e3e658c547ce (patch)
tree2db2ca61ebff90498936e70b618e6cd1f085fad7 /src/file-manager/fm-list-view.c
parente83410a4fc27b60f5146ea67037c627ef5168654 (diff)
downloadcaja-188233e09c64f73238d165e90c72e3e658c547ce.tar.bz2
caja-188233e09c64f73238d165e90c72e3e658c547ce.tar.xz
Fix: wrong behavior with key "enter" while renaming files in list view
Fixes https://github.com/mate-desktop/caja/issues/698
Diffstat (limited to 'src/file-manager/fm-list-view.c')
-rw-r--r--src/file-manager/fm-list-view.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index c3fcd498..b462c3be 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -1099,6 +1099,7 @@ static gboolean
key_press_callback (GtkWidget *widget, GdkEventKey *event, gpointer callback_data)
{
FMDirectoryView *view;
+ FMListView *listview;
GdkEventButton button_event = { 0 };
gboolean handled;
GtkTreeView *tree_view;
@@ -1107,6 +1108,7 @@ key_press_callback (GtkWidget *widget, GdkEventKey *event, gpointer callback_dat
tree_view = GTK_TREE_VIEW (widget);
view = FM_DIRECTORY_VIEW (callback_data);
+ listview = FM_LIST_VIEW (view);
handled = FALSE;
switch (event->keyval)
@@ -1167,17 +1169,26 @@ key_press_callback (GtkWidget *widget, GdkEventKey *event, gpointer callback_dat
break;
case GDK_KEY_Return:
case GDK_KEY_KP_Enter:
- if ((event->state & GDK_SHIFT_MASK) != 0)
- {
- activate_selected_items_alternate (FM_LIST_VIEW (view), NULL, TRUE);
- }
- else
- {
- activate_selected_items (FM_LIST_VIEW (view));
- }
- handled = TRUE;
+ if (GTK_IS_CELL_EDITABLE (listview->details->editable_widget) &&
+ ((event->state & GDK_SHIFT_MASK) || (event->state & GDK_CONTROL_MASK)))
+ {
+ event->state = 0;
+ handled = FALSE;
+ }
+ else
+ {
+ if ((event->state & GDK_SHIFT_MASK) != 0)
+ {
+ activate_selected_items_alternate (FM_LIST_VIEW (view), NULL, TRUE);
+ }
+ else
+ {
+ activate_selected_items (FM_LIST_VIEW (view));
+ }
+ handled = TRUE;
+ }
break;
- case GDK_KEY_v:
+ case GDK_KEY_v:
/* Eat Control + v to not enable type ahead */
if ((event->state & GDK_CONTROL_MASK) != 0)
{