Skip to content

Commit 6476b0a

Browse files
committed
Fixed Final Cut Pro Viewer Detection in macOS 15
1 parent 67c7c3b commit 6476b0a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/extensions/cp/apple/finalcutpro/viewer/ControlBar.lua

+26
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ local Group = require "cp.ui.Group"
1818
local Image = require "cp.ui.Image"
1919
local StaticText = require "cp.ui.StaticText"
2020

21+
local semver = require "semver"
22+
2123
local rightToLeft = axutils.compare.rightToLeft
2224
local cache = axutils.cache
2325
local childFromBottom = axutils.childFromBottom
@@ -30,6 +32,8 @@ local ninjaMouseClick = tools.ninjaMouseClick
3032

3133
local ControlBar = Group:subclass("cp.apple.finalcutpro.viewer.ControlBar")
3234

35+
local macOSVersion = tools.macOSVersion()
36+
3337
--- cp.apple.finalcutpro.viewer.ControlBar.matches(element) -> boolean
3438
--- Function
3539
--- Checks if the element is a `ControlBar` instance.
@@ -43,6 +47,28 @@ function ControlBar.static.matches(element)
4347
if Group.matches(element) and #element >= 4 then
4448
-- Note: sorting right-to-left
4549
local children = axutils.children(element, rightToLeft)
50+
51+
--------------------------------------------------------------------------------
52+
-- macOS 15 Sequoia seems to have a slightly different window layout:
53+
--------------------------------------------------------------------------------
54+
if semver(macOSVersion) >= semver("15.0.0") then
55+
return Button.matches(children[1])
56+
and Button.matches(children[2])
57+
and StaticText.matches(children[4])
58+
and (
59+
(
60+
-- Normal Control Bar:
61+
Button.matches(children[3])
62+
and Button.matches(children[5])
63+
)
64+
or
65+
(
66+
-- Timecode Entry Mode:
67+
Image.matches(children[4])
68+
)
69+
)
70+
end
71+
4672
return Button.matches(children[1])
4773
and Button.matches(children[2])
4874
and StaticText.matches(children[3])

0 commit comments

Comments
 (0)