Skip to content

Commit a1c9a67

Browse files
committed
Treat emacs child frames as popups
Emacs child frames (posframes, corfu completion popups, etc.) are transient UI elements that should not be managed by Aerospace. Fixes #776
1 parent 85f80bd commit a1c9a67

File tree

3 files changed

+128
-0
lines changed

3 files changed

+128
-0
lines changed

Sources/AppBundle/model/AxUiElementWindowType.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ extension AxUiElementMock {
133133
return false
134134
}
135135

136+
// Emacs child frames (posframes, corfu completion popups, etc.)
137+
// These are transient UI elements that should not be managed as windows.
138+
// https://github.com/nikitabobko/AeroSpace/issues/776
139+
if id == .emacs &&
140+
get(Ax.subroleAttr) == kAXFloatingWindowSubrole &&
141+
get(Ax.isMainAttr) == false
142+
{
143+
return false
144+
}
145+
136146
if id?.isFirefox != true {
137147
return isWindowHeuristicOld(axApp: axApp, id)
138148
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"AXActivationPoint" : "<AXValue 0x88dc9a940> {value = x:-1.000000 y:1801.000000 type = kAXValueCGPointType}",
3+
"AXCancelButton" : null,
4+
"AXCloseButton" : null,
5+
"AXDefaultButton" : null,
6+
"AXDocument" : null,
7+
"AXFocused" : 0,
8+
"AXFrame" : "<AXValue 0x88c4e4240> {value = x:1518.000000 y:920.000000 w:270.000000 h:242.000000 type = kAXValueCGRectType}",
9+
"AXFullScreen" : 0,
10+
"AXFullScreenButton" : null,
11+
"AXGrowArea" : null,
12+
"AXMain" : 0,
13+
"AXMinimizeButton" : null,
14+
"AXMinimized" : 0,
15+
"AXModal" : 0,
16+
"AXParent" : "<AXUIElement Application 0x88c445200> {pid=39373}",
17+
"AXPosition" : "<AXValue 0x88e0084b0> {value = x:1518.000000 y:920.000000 type = kAXValueCGPointType}",
18+
"AXProxy" : null,
19+
"AXRole" : "AXWindow",
20+
"AXSections" : [],
21+
"AXSize" : "<AXValue 0x88dc9b4e0> {value = w:270.000000 h:242.000000 type = kAXValueCGSizeType}",
22+
"AXSubrole" : "AXFloatingWindow",
23+
"AXTitle" : "EmacsCorfuGUI",
24+
"AXTitleUIElement" : null,
25+
"AXToolbarButton" : null,
26+
"AXZoomButton" : null,
27+
"Aero.AXApp" : {
28+
"AXExtrasMenuBar" : null,
29+
"AXFocusedUIElement" : "AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
30+
"AXFocusedWindow" : "AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
31+
"AXFrame" : null,
32+
"AXFrontmost" : 1,
33+
"AXFunctionRowTopLevelElements" : [],
34+
"AXMainWindow" : "AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
35+
"AXMenuBar" : "<AXUIElement 0x88c445200> {pid=39373}",
36+
"AXPosition" : null,
37+
"AXRole" : "AXApplication",
38+
"AXSize" : null,
39+
"AXTitle" : "Emacs",
40+
"AXWindows" : [
41+
"AXUIElement(AxWindowId=78635, title=\"EmacsCorfuGUI\", role=\"AXWindow\", subrole=\"AXFloatingWindow\")",
42+
"AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")"
43+
],
44+
"Aero.AxIgnored" : "AXChildren, AXChildrenInNavigationOrder, AXEnhancedUserInterface, AXPreferredLanguage, AXRoleDescription, AXHidden"
45+
},
46+
"Aero.App.appBundleId" : "org.gnu.Emacs",
47+
"Aero.App.nsApp.activationPolicy" : "regular",
48+
"Aero.App.nsApp.execPath" : "file:///opt/homebrew/Cellar/emacs-plus@30/30.2/Emacs.app/Contents/MacOS/Emacs-real",
49+
"Aero.App.version" : "9.0",
50+
"Aero.App.versionShort" : "30.2",
51+
"Aero.AxIgnored" : "AXChildrenInNavigationOrder, AXChildren, AXRoleDescription",
52+
"Aero.axWindowId" : 78635,
53+
"Aero.AxUiElementWindowType_isDialogHeuristic" : true,
54+
"Aero.AxUiElementWindowType" : "popup",
55+
"Aero.on-window-detected" : [],
56+
"Aero.treeNodeParent" : "AppBundle.Workspace",
57+
"Aero.windowLevel" : "normalWindow",
58+
"Aero.workspace" : "1"
59+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"AXActivationPoint" : "<AXValue 0x88dc9b4e0> {value = x:-1.000000 y:1801.000000 type = kAXValueCGPointType}",
3+
"AXCancelButton" : null,
4+
"AXCloseButton" : null,
5+
"AXDefaultButton" : null,
6+
"AXDocument" : null,
7+
"AXFocused" : 0,
8+
"AXFrame" : "<AXValue 0x88c4e5900> {value = x:1607.000000 y:873.000000 w:490.000000 h:32.000000 type = kAXValueCGRectType}",
9+
"AXFullScreen" : 0,
10+
"AXFullScreenButton" : null,
11+
"AXGrowArea" : null,
12+
"AXMain" : 0,
13+
"AXMinimizeButton" : null,
14+
"AXMinimized" : 0,
15+
"AXModal" : 0,
16+
"AXParent" : "<AXUIElement Application 0x88c447570> {pid=39373}",
17+
"AXPosition" : "<AXValue 0x88dc9bcf0> {value = x:1607.000000 y:873.000000 type = kAXValueCGPointType}",
18+
"AXProxy" : null,
19+
"AXRole" : "AXWindow",
20+
"AXSections" : [],
21+
"AXSize" : "<AXValue 0x88dc9bab0> {value = w:490.000000 h:32.000000 type = kAXValueCGSizeType}",
22+
"AXSubrole" : "AXFloatingWindow",
23+
"AXTitle" : "posframe",
24+
"AXTitleUIElement" : null,
25+
"AXToolbarButton" : null,
26+
"AXZoomButton" : null,
27+
"Aero.AXApp" : {
28+
"AXExtrasMenuBar" : null,
29+
"AXFocusedUIElement" : "AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
30+
"AXFocusedWindow" : "AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
31+
"AXFrame" : null,
32+
"AXFrontmost" : 0,
33+
"AXFunctionRowTopLevelElements" : [],
34+
"AXMainWindow" : "AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
35+
"AXMenuBar" : "<AXUIElement 0x88c447570> {pid=39373}",
36+
"AXPosition" : null,
37+
"AXRole" : "AXApplication",
38+
"AXSize" : null,
39+
"AXTitle" : "Emacs",
40+
"AXWindows" : [
41+
"AXUIElement(AxWindowId=78636, title=\"posframe\", role=\"AXWindow\", subrole=\"AXFloatingWindow\")",
42+
"AXUIElement(AxWindowId=78408, title=\"test.py – Doom Emacs\", role=\"AXWindow\", subrole=\"AXStandardWindow\")"
43+
],
44+
"Aero.AxIgnored" : "AXChildren, AXChildrenInNavigationOrder, AXEnhancedUserInterface, AXPreferredLanguage, AXRoleDescription, AXHidden"
45+
},
46+
"Aero.App.appBundleId" : "org.gnu.Emacs",
47+
"Aero.App.nsApp.activationPolicy" : "regular",
48+
"Aero.App.nsApp.execPath" : "file:///opt/homebrew/Cellar/emacs-plus@30/30.2/Emacs.app/Contents/MacOS/Emacs-real",
49+
"Aero.App.version" : "9.0",
50+
"Aero.App.versionShort" : "30.2",
51+
"Aero.AxIgnored" : "AXChildrenInNavigationOrder, AXChildren, AXRoleDescription",
52+
"Aero.axWindowId" : 78636,
53+
"Aero.AxUiElementWindowType_isDialogHeuristic" : true,
54+
"Aero.AxUiElementWindowType" : "popup",
55+
"Aero.on-window-detected" : [],
56+
"Aero.treeNodeParent" : "AppBundle.Workspace",
57+
"Aero.windowLevel" : "normalWindow",
58+
"Aero.workspace" : "1"
59+
}

0 commit comments

Comments
 (0)