Kaydet (Commit) 46e7e124 authored tarafından Enrico Tröger's avatar Enrico Tröger

After opening files, focus the editor widget (based on a patch by Can Koy, thanks).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4736 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst c5e50e29
...@@ -444,7 +444,7 @@ static void on_external_open(GtkMenuItem *menuitem, gpointer user_data) ...@@ -444,7 +444,7 @@ static void on_external_open(GtkMenuItem *menuitem, gpointer user_data)
/* We use document_open_files() as it's more efficient. */ /* We use document_open_files() as it's more efficient. */
static void open_selected_files(GList *list) static void open_selected_files(GList *list, gboolean do_not_focus)
{ {
GSList *files = NULL; GSList *files = NULL;
GList *item; GList *item;
...@@ -459,7 +459,7 @@ static void open_selected_files(GList *list) ...@@ -459,7 +459,7 @@ static void open_selected_files(GList *list)
} }
document_open_files(files, FALSE, NULL, NULL); document_open_files(files, FALSE, NULL, NULL);
doc = document_get_current(); doc = document_get_current();
if (doc != NULL) if (doc != NULL && ! do_not_focus)
keybindings_send_command(GEANY_KEY_GROUP_FOCUS, GEANY_KEYS_FOCUS_EDITOR); keybindings_send_command(GEANY_KEY_GROUP_FOCUS, GEANY_KEYS_FOCUS_EDITOR);
g_slist_foreach(files, (GFunc) g_free, NULL); /* free filenames */ g_slist_foreach(files, (GFunc) g_free, NULL); /* free filenames */
...@@ -498,7 +498,7 @@ static void on_open_clicked(GtkMenuItem *menuitem, gpointer user_data) ...@@ -498,7 +498,7 @@ static void on_open_clicked(GtkMenuItem *menuitem, gpointer user_data)
} }
} }
else else
open_selected_files(list); open_selected_files(list, GPOINTER_TO_INT(user_data));
g_list_foreach(list, (GFunc) gtk_tree_path_free, NULL); g_list_foreach(list, (GFunc) gtk_tree_path_free, NULL);
g_list_free(list); g_list_free(list);
...@@ -651,13 +651,18 @@ static gboolean on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer dat ...@@ -651,13 +651,18 @@ static gboolean on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer dat
{ {
if (event->keyval == GDK_Return if (event->keyval == GDK_Return
|| event->keyval == GDK_ISO_Enter || event->keyval == GDK_ISO_Enter
|| event->keyval == GDK_KP_Enter || event->keyval == GDK_KP_Enter)
|| event->keyval == GDK_space)
{ {
on_open_clicked(NULL, NULL); on_open_clicked(NULL, NULL);
return TRUE; return TRUE;
} }
if (event->keyval == GDK_space)
{
on_open_clicked(NULL, GINT_TO_POINTER(TRUE));
return TRUE;
}
if ((event->keyval == GDK_Up || if ((event->keyval == GDK_Up ||
event->keyval == GDK_KP_Up) && event->keyval == GDK_KP_Up) &&
(event->state & GDK_MOD1_MASK)) /* FIXME: Alt-Up doesn't seem to work! */ (event->state & GDK_MOD1_MASK)) /* FIXME: Alt-Up doesn't seem to work! */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment