aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2015-01-20 17:57:06 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2015-01-20 17:57:06 -0500
commitae6f50249364fe7caa1c362ffe88a92a8bb0950f (patch)
treea148df960f698b9a57ed3ddb2f973078c1b35a4f /src
parent4598453ad7a2a0dccfb2901a825ac4284fea89f6 (diff)
downloadtextadept-ae6f50249364fe7caa1c362ffe88a92a8bb0950f.tar.gz
textadept-ae6f50249364fe7caa1c362ffe88a92a8bb0950f.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/textadept.c7
1 files changed, 5 insertions, 2 deletions
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