From 26a03aa23bb4d18e7dd18d1a030e0dcad7889159 Mon Sep 17 00:00:00 2001 From: Ksaper Date: Sat, 11 Mar 2023 04:40:22 +0200 Subject: [PATCH] Fix focusing the text input when releasing any mouse button --- widget/app_launcher/text_input.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/widget/app_launcher/text_input.lua b/widget/app_launcher/text_input.lua index 5424400..7668751 100644 --- a/widget/app_launcher/text_input.lua +++ b/widget/app_launcher/text_input.lua @@ -258,13 +258,15 @@ function text_input:set_widget_template(widget_template) end) wp.text_widget:connect_signal("button::release", function(_, lx, ly, button, mods, find_widgets_result) - find_widgets_result.drawable:disconnect_signal("mouse::move", on_drag) - if not wp.selecting_text then - self:set_cursor_index_from_x_y(lx, ly) - else - wp.selecting_text = false + if button == 1 then + find_widgets_result.drawable:disconnect_signal("mouse::move", on_drag) + if not wp.selecting_text then + self:set_cursor_index_from_x_y(lx, ly) + else + wp.selecting_text = false + end + self:focus() end - self:focus() end) wp.text_widget:connect_signal("mouse::enter", function()