Fix focusing the text input when releasing any mouse button

This commit is contained in:
Ksaper 2023-03-11 04:40:22 +02:00
parent 301d23e4cf
commit 26a03aa23b
1 changed files with 8 additions and 6 deletions

View File

@ -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()