diff options
author | mitchell <70453897+orbitalquark@users.noreply.github.com> | 2020-11-16 12:34:38 -0500 |
---|---|---|
committer | mitchell <70453897+orbitalquark@users.noreply.github.com> | 2020-11-16 12:34:38 -0500 |
commit | 814ee8d5f440e2c71d3b4d978510490d12e46e8d (patch) | |
tree | bb0b3d099accd76420bb149a405201d4df607d7d /src/textadept.c | |
parent | 53631f9229b235f4fe203845a14d257105e070f6 (diff) |
Keep focus on find & replace pane as necessary when refocusing window.
Diffstat (limited to 'src/textadept.c')
-rw-r--r-- | src/textadept.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/textadept.c b/src/textadept.c index eb96e274..c51af911 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -1643,10 +1643,8 @@ static bool init_lua(lua_State *L, int argc, char **argv, bool reinit) { #if GTK /** Signal for a Textadept window focus change. */ static bool window_focused(GtkWidget *_, GdkEventFocus *__, void *L) { - if (command_entry_focused) return false; // keep command entry focused - if (focused_view && !gtk_widget_has_focus(focused_view)) - gtk_widget_grab_focus(focused_view); - return (emit(L, "focus", -1), false); + if (!command_entry_focused) emit(L, "focus", -1); + return false; } /** Signal for a Textadept keypress. */ @@ -2352,6 +2350,7 @@ static void new_window() { gtk_box_pack_start(GTK_BOX(vboxp), hbox, true, true, 0); gtk_box_pack_start(GTK_BOX(hbox), new_view(0), true, true, 0); + gtk_widget_grab_focus(focused_view); gtk_box_pack_start(GTK_BOX(vboxp), new_findbox(), false, false, 5); |