From 132b7623c504071327227503ca9f78d79518b087 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 4 Nov 2018 03:54:02 +0100 Subject: Key press event is triggered when textview is disabled... --- src/ChatWindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChatWindow.cpp b/src/ChatWindow.cpp index f7cc5e2..a991e57 100644 --- a/src/ChatWindow.cpp +++ b/src/ChatWindow.cpp @@ -169,8 +169,11 @@ namespace dchat { if((event->keyval == GDK_KEY_Return || event->keyval == GDK_KEY_KP_Enter) && !(event->state & Gdk::SHIFT_MASK)) { - currentRoom->publishMessage(chatInput.get_buffer()->get_text()); - chatInput.get_buffer()->set_text(""); + if(chatInput.get_editable()) + { + currentRoom->publishMessage(chatInput.get_buffer()->get_text()); + chatInput.get_buffer()->set_text(""); + } return true; } return false; -- cgit v1.2.3