Fix focusing the text input when releasing any mouse button
This commit is contained in:
parent
301d23e4cf
commit
26a03aa23b
|
@ -258,13 +258,15 @@ function text_input:set_widget_template(widget_template)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
wp.text_widget:connect_signal("button::release", function(_, lx, ly, button, mods, find_widgets_result)
|
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 button == 1 then
|
||||||
if not wp.selecting_text then
|
find_widgets_result.drawable:disconnect_signal("mouse::move", on_drag)
|
||||||
self:set_cursor_index_from_x_y(lx, ly)
|
if not wp.selecting_text then
|
||||||
else
|
self:set_cursor_index_from_x_y(lx, ly)
|
||||||
wp.selecting_text = false
|
else
|
||||||
|
wp.selecting_text = false
|
||||||
|
end
|
||||||
|
self:focus()
|
||||||
end
|
end
|
||||||
self:focus()
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
wp.text_widget:connect_signal("mouse::enter", function()
|
wp.text_widget:connect_signal("mouse::enter", function()
|
||||||
|
|
Loading…
Reference in New Issue