Roblox backend: forget the last mouse position when the window gains / loses focus (losing focus clears imgui's mouse to unavailable and NewFrame only resends a moved mouse, so a click on return without moving first landed nowhere); rebuilt build/ImGui.luau

This commit is contained in:
4DBug committed 2026-10-25 05:44:24 -05:00
1 parent 3bac70663f
commit b83d09de0c
3 files changed
+21 -5

No files matched your search

+10 -2
View File
@@ -217,8 +217,16 @@ function ImGui_ImplRoblox_Init(parent, render_scale)
BackendData.HeartbeatCount += 1
end)
connect(UserInputService.WindowFocused, function() ImGui.GetIO():AddFocusEvent(true) end)
connect(UserInputService.WindowFocusReleased, function() ImGui.GetIO():AddFocusEvent(false) end)
-- (losing focus clears imgui's mouse to "unavailable"; NewFrame only resends a moved mouse, so on return forget the
-- last position: a click on a field without moving the mouse first would otherwise land nowhere)
connect(UserInputService.WindowFocused, function()
ImGui.GetIO():AddFocusEvent(true)
BackendData.MouseX, BackendData.MouseY = nil, nil
end)
connect(UserInputService.WindowFocusReleased, function()
ImGui.GetIO():AddFocusEvent(false)
BackendData.MouseX, BackendData.MouseY = nil, nil
end)
end
-- Text proxy (opt-in): a hidden TextBox holds focus while a text field is active (OS typing, paste, copy/cut)
+1 -1
View File
@@ -1 +1 @@
[[57, "imgui.lua"], [22812, "imgui_demo.lua"], [34672, "imgui_draw.lua"], [43097, "imgui_h.lua"], [46107, "roblox/raster.lua"], [47714, "roblox/textures.lua"], [47965, "roblox/layers.lua"], [48387, "roblox/overlays.lua"], [48468, "roblox/render.lua"], [49763, "roblox/parallel.lua"], [50295, "roblox/patches.lua"], [50580, "imgui_impl_roblox.lua"], [51084, "imgui_impl_roblox_fonts.lua"], [57489, "imgui_internal.lua"], [61474, "imgui_tables.lua"], [66602, "imgui_widgets.lua"], [78990, "imstb_rectpack.lua"], [79667, "imstb_textedit.lua"], [81209, "imstb_truetype.lua"], [84143, "imstd_minstdio.lua"]]
[[57, "imgui.lua"], [22812, "imgui_demo.lua"], [34672, "imgui_draw.lua"], [43097, "imgui_h.lua"], [46107, "roblox/raster.lua"], [47714, "roblox/textures.lua"], [47965, "roblox/layers.lua"], [48387, "roblox/overlays.lua"], [48468, "roblox/render.lua"], [49763, "roblox/parallel.lua"], [50295, "roblox/patches.lua"], [50580, "imgui_impl_roblox.lua"], [51092, "imgui_impl_roblox_fonts.lua"], [57497, "imgui_internal.lua"], [61482, "imgui_tables.lua"], [66610, "imgui_widgets.lua"], [78998, "imstb_rectpack.lua"], [79675, "imstb_textedit.lua"], [81217, "imstb_truetype.lua"], [84151, "imstd_minstdio.lua"]]
+10 -2
View File
@@ -50796,8 +50796,16 @@ function ImGui_ImplRoblox_Init(parent, render_scale)
BackendData.HeartbeatCount += 1
end)
connect(UserInputService.WindowFocused, function() ImGui.GetIO():AddFocusEvent(true) end)
connect(UserInputService.WindowFocusReleased, function() ImGui.GetIO():AddFocusEvent(false) end)
-- (losing focus clears imgui's mouse to "unavailable"; NewFrame only resends a moved mouse, so on return forget the
-- last position: a click on a field without moving the mouse first would otherwise land nowhere)
connect(UserInputService.WindowFocused, function()
ImGui.GetIO():AddFocusEvent(true)
BackendData.MouseX, BackendData.MouseY = nil, nil
end)
connect(UserInputService.WindowFocusReleased, function()
ImGui.GetIO():AddFocusEvent(false)
BackendData.MouseX, BackendData.MouseY = nil, nil
end)
end
-- Text proxy (opt-in): a hidden TextBox holds focus while a text field is active (OS typing, paste, copy/cut)