From ae6f50249364fe7caa1c362ffe88a92a8bb0950f Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 20 Jan 2015 17:57:06 -0500 Subject: Fixed bug in preventing standard focus out events to be fired; src/textadept.c It is desirable to keep the command entry visible if the window is losing focus. Otherwise, allow normal focus out events to be fired, including Scintilla's defaults that hide the cursor, etc. --- src/textadept.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/textadept.c b/src/textadept.c index a7eb01c8..8bc8c2bf 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -2253,9 +2253,12 @@ static GtkWidget *new_findbox() { return findbox; } -/** Emit "Escape" key for the command entry on focus lost. */ +/** + * Emit "Escape" key for the command entry on focus lost unless the window is + * losing focus. + */ static int wc_focusout(GtkWidget *widget, GdkEvent*_, void*__) { - if (widget == window) return TRUE; // keep focus if window is losing focus + if (widget == window && command_entry_focused) return TRUE; return (lL_event(lua, "keypress", LUA_TNUMBER, GDK_Escape, -1), FALSE); } #endif // if GTK -- cgit v1.2.3