From 41e2478a6f79d56234c674ebb5ab7f7c2954ee2d Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Mon, 4 Jul 2022 03:29:30 -0400 Subject: [PATCH] grab focus when adding attachment --- src/components/chatinput.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/chatinput.cpp b/src/components/chatinput.cpp index 49c5b5d..b71a234 100644 --- a/src/components/chatinput.cpp +++ b/src/components/chatinput.cpp @@ -382,10 +382,13 @@ void ChatInput::AddAttachment(const Glib::RefPtr &file) { }; if (image_exts.find(content_type) != image_exts.end()) { - if (AddFileAsImageAttachment(file)) + if (AddFileAsImageAttachment(file)) { m_attachments_revealer.set_reveal_child(true); + m_input.grab_focus(); + } } else if (m_attachments.AddFile(file)) { m_attachments_revealer.set_reveal_child(true); + m_input.grab_focus(); } }