Skip to content

Commit fdc3884

Browse files
committed
prevent mouse clicks over ZScreen windows from bleeding through
1 parent ca01706 commit fdc3884

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Template for new versions:
5757
- `tweak`: ``realistic-melting``: change melting return for inorganic armor parts, shields, weapons, trap components and tools to stop smelters from creating metal, bring melt return for adamantine in line with other metals to ~95% of forging cost. wear reduces melt return by 10% per level
5858

5959
## Fixes
60+
- Fix mouse clicks bleeding through DFHack windows when clicking in the space between the frame and the window content in resizable windows
6061

6162
## Misc Improvements
6263
- DFHack text edit fields now delete the character at the cursor when you hit the Delete key

library/lua/gui.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ function ZScreen:onInput(keys)
11271127
self:dismiss()
11281128
else
11291129
local passit = self.pass_pause and keys.D_PAUSE
1130-
if not passit and self.pass_mouse_clicks then
1130+
if not passit and self.pass_mouse_clicks and not has_mouse then
11311131
if keys.CONTEXT_SCROLL_UP or keys.CONTEXT_SCROLL_DOWN or
11321132
keys.CONTEXT_SCROLL_PAGEUP or keys.CONTEXT_SCROLL_PAGEDOWN then
11331133
passit = true
@@ -1164,7 +1164,7 @@ end
11641164

11651165
function ZScreen:isMouseOver()
11661166
for _,sv in ipairs(self.subviews) do
1167-
if sv.visible and sv:getMouseFramePos() then return true end
1167+
if utils.getval(sv.visible) and sv:getMouseFramePos() then return true end
11681168
end
11691169
end
11701170

0 commit comments

Comments
 (0)