diff --git a/Sources/AppBundle/model/AxUiElementWindowType.swift b/Sources/AppBundle/model/AxUiElementWindowType.swift index 19e6a5f96..014c15dad 100644 --- a/Sources/AppBundle/model/AxUiElementWindowType.swift +++ b/Sources/AppBundle/model/AxUiElementWindowType.swift @@ -133,6 +133,16 @@ extension AxUiElementMock { return false } + // Emacs child frames (posframes, corfu completion popups, etc.) + // These are transient UI elements that should not be managed as windows. + // https://github.com/nikitabobko/AeroSpace/issues/776 + if id == .emacs && + get(Ax.subroleAttr) == kAXFloatingWindowSubrole && + get(Ax.isMainAttr) == false + { + return false + } + if id?.isFirefox != true { return isWindowHeuristicOld(axApp: axApp, id) } diff --git a/axDumps/emacs.json5 b/axDumps/emacs.json5 new file mode 100644 index 000000000..6e8ed548e --- /dev/null +++ b/axDumps/emacs.json5 @@ -0,0 +1,111 @@ +{ + "AXActivationPoint" : " {value = x:75.000000 y:58.000000 type = kAXValueCGPointType}", + "AXCancelButton" : null, + "AXCloseButton" : { + "AXEnabled" : 1, + "AXParent" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXRole" : "AXButton", + "AXSubrole" : "AXCloseButton", + "AXTitle" : null, + "AXTopLevelUIElement" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXWindow" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "Aero.AxFailed" : "get.AXTitle(noValue)", + "Aero.AxIgnored" : "AXFrame, AXSize, AXFocused, AXHelp, AXPosition, AXRoleDescription, AXEdited" + }, + "AXDefaultButton" : null, + "AXDocument" : null, + "AXFocused" : 1, + "AXFrame" : " {value = x:5.000000 y:44.000000 w:893.000000 h:1119.000000 type = kAXValueCGRectType}", + "AXFullScreen" : 0, + "AXFullScreenButton" : { + "AXEnabled" : 1, + "AXParent" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXRole" : "AXButton", + "AXSubrole" : "AXFullScreenButton", + "AXTitle" : null, + "AXTopLevelUIElement" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXWindow" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "Aero.AxFailed" : "get.AXTitle(noValue)", + "Aero.AxIgnored" : "AXFrame, AXSize, AXFocused, AXChildren, AXHelp, AXPosition, AXRoleDescription" + }, + "AXGrowArea" : null, + "AXMain" : 1, + "AXMinimizeButton" : { + "AXEnabled" : 1, + "AXParent" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXRole" : "AXButton", + "AXSubrole" : "AXMinimizeButton", + "AXTitle" : null, + "AXTopLevelUIElement" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXWindow" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "Aero.AxFailed" : "get.AXTitle(noValue)", + "Aero.AxIgnored" : "AXFrame, AXSize, AXFocused, AXHelp, AXPosition, AXRoleDescription" + }, + "AXMinimized" : 0, + "AXModal" : 0, + "AXParent" : " {pid=6999}", + "AXPosition" : " {value = x:5.000000 y:44.000000 type = kAXValueCGPointType}", + "AXProxy" : null, + "AXRole" : "AXWindow", + "AXSections" : [ + "{\n SectionDescription = Content;\n SectionObject = \" {pid=6999}\";\n SectionUniqueID = AXContent;\n}" + ], + "AXSize" : " {value = w:893.000000 h:1119.000000 type = kAXValueCGSizeType}", + "AXSubrole" : "AXStandardWindow", + "AXTitle" : "*doom* – Doom Emacs — (109 × 67)", + "AXTitleUIElement" : "AXUIElement(AxWindowId=86039, title=nil, role=\"AXStaticText\", subrole=nil)", + "AXToolbarButton" : null, + "AXZoomButton" : { + "AXEnabled" : 1, + "AXParent" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXRole" : "AXButton", + "AXSubrole" : "AXFullScreenButton", + "AXTitle" : null, + "AXTopLevelUIElement" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXWindow" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "Aero.AxFailed" : "get.AXTitle(noValue)", + "Aero.AxIgnored" : "AXFrame, AXSize, AXFocused, AXChildren, AXHelp, AXPosition, AXRoleDescription" + }, + "Aero.AXApp" : { + "AXExtrasMenuBar" : null, + "AXFocusedUIElement" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXFocusedWindow" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXFrame" : null, + "AXFrontmost" : 1, + "AXFunctionRowTopLevelElements" : [ + + ], + "AXMainWindow" : "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXMenuBar" : " {pid=6999}", + "AXPosition" : null, + "AXRole" : "AXApplication", + "AXSize" : null, + "AXTitle" : "Emacs", + "AXWindows" : [ + "AXUIElement(AxWindowId=86039, title=\"*doom* – Doom Emacs — (109 × 67)\", role=\"AXWindow\", subrole=\"AXStandardWindow\")" + ], + "Aero.AxFailed" : "isWritable.AXFunctionRowTopLevelElements(failure), get.AXFrame(attributeUnsupported), isWritable.AXFrame(failure), get.AXExtrasMenuBar(noValue), isWritable.AXExtrasMenuBar(failure), get.AXSize(attributeUnsupported), isWritable.AXSize(attributeUnsupported), get.AXPosition(attributeUnsupported), isWritable.AXPosition(attributeUnsupported)", + "Aero.AxIgnored" : "AXChildren, AXChildrenInNavigationOrder, AXEnhancedUserInterface, AXPreferredLanguage, AXRoleDescription, AXHidden", + "Aero.AxWritable" : "AXFrontmost" + }, + "Aero.App.appBundleId" : "org.gnu.Emacs", + "Aero.App.nsApp.activationPolicy" : "regular", + "Aero.App.nsApp.appBundlePath" : "file:///opt/homebrew/Cellar/emacs-plus@30/30.2/Emacs.app/", + "Aero.App.nsApp.execPath" : "file:///opt/homebrew/Cellar/emacs-plus@30/30.2/Emacs.app/Contents/MacOS/Emacs-real", + "Aero.App.pid" : 6999, + "Aero.App.version" : "9.0", + "Aero.App.versionShort" : "30.2", + "Aero.AxFailed" : "isWritable.AXFrame(failure), get.AXGrowArea(failure), get.AXDocument(noValue), isWritable.AXActivationPoint(failure), get.AXProxy(noValue), get.AXDefaultButton(noValue), get.AXCancelButton(noValue), get.AXToolbarButton(noValue)", + "Aero.AxIgnored" : "AXChildrenInNavigationOrder, AXChildren, AXRoleDescription", + "Aero.AxUiElementWindowType" : "window", + "Aero.AxUiElementWindowType_isDialogHeuristic" : false, + "Aero.AxWritable" : "AXFullScreen, AXPosition, AXSections, AXMain, AXMinimized, AXSize", + "Aero.axWindowId" : 86039, + "Aero.macOS.version" : "Version 26.2 (Build 25C56)", + "Aero.on-window-detected" : [ + + ], + "Aero.treeNodeParent" : "Optional(AppBundle.TilingContainer)", + "Aero.windowLevel" : "normalWindow", + "Aero.workspace" : "1" +} diff --git a/axDumps/emacs_child_frame_corfu.json5 b/axDumps/emacs_child_frame_corfu.json5 new file mode 100644 index 000000000..4624c0fa4 --- /dev/null +++ b/axDumps/emacs_child_frame_corfu.json5 @@ -0,0 +1,60 @@ +// (enable/configure corfu) -> start typing -> select corfu completion candidate... +{ + "AXActivationPoint" : " {value = x:-1.000000 y:1801.000000 type = kAXValueCGPointType}", + "AXCancelButton" : null, + "AXCloseButton" : null, + "AXDefaultButton" : null, + "AXDocument" : null, + "AXFocused" : 0, + "AXFrame" : " {value = x:1518.000000 y:920.000000 w:270.000000 h:242.000000 type = kAXValueCGRectType}", + "AXFullScreen" : 0, + "AXFullScreenButton" : null, + "AXGrowArea" : null, + "AXMain" : 0, + "AXMinimizeButton" : null, + "AXMinimized" : 0, + "AXModal" : 0, + "AXParent" : " {pid=39373}", + "AXPosition" : " {value = x:1518.000000 y:920.000000 type = kAXValueCGPointType}", + "AXProxy" : null, + "AXRole" : "AXWindow", + "AXSections" : [], + "AXSize" : " {value = w:270.000000 h:242.000000 type = kAXValueCGSizeType}", + "AXSubrole" : "AXFloatingWindow", + "AXTitle" : "EmacsCorfuGUI", + "AXTitleUIElement" : null, + "AXToolbarButton" : null, + "AXZoomButton" : null, + "Aero.AXApp" : { + "AXExtrasMenuBar" : null, + "AXFocusedUIElement" : "AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXFocusedWindow" : "AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXFrame" : null, + "AXFrontmost" : 1, + "AXFunctionRowTopLevelElements" : [], + "AXMainWindow" : "AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXMenuBar" : " {pid=39373}", + "AXPosition" : null, + "AXRole" : "AXApplication", + "AXSize" : null, + "AXTitle" : "Emacs", + "AXWindows" : [ + "AXUIElement(AxWindowId=78635, title=\"EmacsCorfuGUI\", role=\"AXWindow\", subrole=\"AXFloatingWindow\")", + "AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")" + ], + "Aero.AxIgnored" : "AXChildren, AXChildrenInNavigationOrder, AXEnhancedUserInterface, AXPreferredLanguage, AXRoleDescription, AXHidden" + }, + "Aero.App.appBundleId" : "org.gnu.Emacs", + "Aero.App.nsApp.activationPolicy" : "regular", + "Aero.App.nsApp.execPath" : "file:///opt/homebrew/Cellar/emacs-plus@30/30.2/Emacs.app/Contents/MacOS/Emacs-real", + "Aero.App.version" : "9.0", + "Aero.App.versionShort" : "30.2", + "Aero.AxIgnored" : "AXChildrenInNavigationOrder, AXChildren, AXRoleDescription", + "Aero.axWindowId" : 78635, + "Aero.AxUiElementWindowType_isDialogHeuristic" : true, + "Aero.AxUiElementWindowType" : "popup", + "Aero.on-window-detected" : [], + "Aero.treeNodeParent" : "AppBundle.Workspace", + "Aero.windowLevel" : "normalWindow", + "Aero.workspace" : "1" +} diff --git a/axDumps/emacs_child_frame_posframe.json5 b/axDumps/emacs_child_frame_posframe.json5 new file mode 100644 index 000000000..68d05dad5 --- /dev/null +++ b/axDumps/emacs_child_frame_posframe.json5 @@ -0,0 +1,60 @@ +// (enable/configure flycheck-posframe) -> provoke syntax error -> select flycheck-posframe error list candidate... +{ + "AXActivationPoint" : " {value = x:-1.000000 y:1801.000000 type = kAXValueCGPointType}", + "AXCancelButton" : null, + "AXCloseButton" : null, + "AXDefaultButton" : null, + "AXDocument" : null, + "AXFocused" : 0, + "AXFrame" : " {value = x:1607.000000 y:873.000000 w:490.000000 h:32.000000 type = kAXValueCGRectType}", + "AXFullScreen" : 0, + "AXFullScreenButton" : null, + "AXGrowArea" : null, + "AXMain" : 0, + "AXMinimizeButton" : null, + "AXMinimized" : 0, + "AXModal" : 0, + "AXParent" : " {pid=39373}", + "AXPosition" : " {value = x:1607.000000 y:873.000000 type = kAXValueCGPointType}", + "AXProxy" : null, + "AXRole" : "AXWindow", + "AXSections" : [], + "AXSize" : " {value = w:490.000000 h:32.000000 type = kAXValueCGSizeType}", + "AXSubrole" : "AXFloatingWindow", + "AXTitle" : "posframe", + "AXTitleUIElement" : null, + "AXToolbarButton" : null, + "AXZoomButton" : null, + "Aero.AXApp" : { + "AXExtrasMenuBar" : null, + "AXFocusedUIElement" : "AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXFocusedWindow" : "AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXFrame" : null, + "AXFrontmost" : 0, + "AXFunctionRowTopLevelElements" : [], + "AXMainWindow" : "AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")", + "AXMenuBar" : " {pid=39373}", + "AXPosition" : null, + "AXRole" : "AXApplication", + "AXSize" : null, + "AXTitle" : "Emacs", + "AXWindows" : [ + "AXUIElement(AxWindowId=78636, title=\"posframe\", role=\"AXWindow\", subrole=\"AXFloatingWindow\")", + "AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")" + ], + "Aero.AxIgnored" : "AXChildren, AXChildrenInNavigationOrder, AXEnhancedUserInterface, AXPreferredLanguage, AXRoleDescription, AXHidden" + }, + "Aero.App.appBundleId" : "org.gnu.Emacs", + "Aero.App.nsApp.activationPolicy" : "regular", + "Aero.App.nsApp.execPath" : "file:///opt/homebrew/Cellar/emacs-plus@30/30.2/Emacs.app/Contents/MacOS/Emacs-real", + "Aero.App.version" : "9.0", + "Aero.App.versionShort" : "30.2", + "Aero.AxIgnored" : "AXChildrenInNavigationOrder, AXChildren, AXRoleDescription", + "Aero.axWindowId" : 78636, + "Aero.AxUiElementWindowType_isDialogHeuristic" : true, + "Aero.AxUiElementWindowType" : "popup", + "Aero.on-window-detected" : [], + "Aero.treeNodeParent" : "AppBundle.Workspace", + "Aero.windowLevel" : "normalWindow", + "Aero.workspace" : "1" +}