fix issues with clicks "falling through" scrollbars

develop
Myk Taylor 2023-01-24 21:28:25 -08:00
parent 5283cb1e72
commit c5f2588522
No known key found for this signature in database
2 changed files with 9 additions and 0 deletions

@ -36,6 +36,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## New Plugins
## Fixes
- Fix issues with clicks "passing through" some DFHack window elements, like scrollbars
## Misc Improvements
- A new cross-compile build script was added for building the Windows files from a Linux Docker builder (see the Compile instructions in the docs)

@ -754,6 +754,7 @@ function ZScreen:onInput(keys)
if keys._MOUSE_L_DOWN then
-- note we can't clear mouse_lbut here. otherwise we break dragging,
df.global.enabler.mouse_lbut_down = 0
self.inhibit_mouse_l = true
end
if keys._MOUSE_R_DOWN then
df.global.enabler.mouse_rbut_down = 0
@ -772,6 +773,13 @@ function ZScreen:onInput(keys)
df.global.enabler.mouse_rbut = 0
return
else
if self.inhibit_mouse_l then
if keys._MOUSE_L then
return
else
self.inhibit_mouse_l = nil
end
end
local passit = self.pass_pause and keys.D_PAUSE
if not passit and self.pass_mouse_clicks then
for key in pairs(MOUSE_KEYS) do