Skip to content

BR_GetMouseCursorContext starts spamming "Toggle Master track visible" #837

@jalovatt

Description

@jalovatt

I'm calling it from a Lua script. In a fresh Reaper session with no tracks, I can reproduce it consistently.

Reaper 5.33 x64, Windows 8.1

br context master spam

gfx.init("", 200, 200, 0, 200, 200)

local function Main()
	
	local char = gfx.getchar()
	if char == -1 or char == 27 then
		return 0
	end
	
	--local wnd, seg, det = "a", "b", "c"   -- <- this code works
	local wnd, seg, det = reaper.BR_GetMouseCursorContext()  -- <- this code doesn't
	
	local str = (not wnd or wnd == "unknown") 
				and	"- No context -"
				or	wnd..
						(not not seg and (" | "..seg..
							(not not det and (" | "..det))))
							
	if string.sub(str, -2) == "| " then str = string.sub(str, 1, -4) end
	
	gfx.x, gfx.y = 10, 10
	gfx.drawstr(str)
	
	gfx.update()
	
	reaper.defer(Main)
	
end

Main()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions