Skip to content

Commit f49dcca

Browse files
authored
Merge pull request #4968 from myk002/myk_pass_mouse
[ZScreen, Panel] prevent mouse clicks from bleeding through
2 parents ca01706 + b2163e9 commit f49dcca

3 files changed

Lines changed: 4 additions & 3 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

library/lua/gui/widgets/containers/panel.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Panel.ATTRS {
7171
---@param args widgets.Panel.initTable
7272
function Panel:init(args)
7373
if not self.drag_anchors then
74-
self.drag_anchors = {title=true, frame=not self.resizable, body=true}
74+
self.drag_anchors = {title=true, frame=true, body=true}
7575
end
7676
if not self.resize_anchors then
7777
self.resize_anchors = {t=false, l=true, r=true, b=true}

0 commit comments

Comments
 (0)