[[on-window-detected]] callback with if.app-id = 'com.github.Electron' inconsistently failing #1562
Replies: 2 comments
-
|
Output from com.github.Electron.14328 ||| {
com.github.Electron.14328 ||| "AXActivationPoint" : "<AXValue 0x6000033ef780> {value = x:1582.000000 y:-476.000000 type = kAXValueCGPointType}",
com.github.Electron.14328 ||| "AXCancelButton" : null,
com.github.Electron.14328 ||| "AXCloseButton" : {
com.github.Electron.14328 ||| "AXEnabled" : 1,
com.github.Electron.14328 ||| "AXParent" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
com.github.Electron.14328 ||| "AXRole" : "AXButton",
com.github.Electron.14328 ||| "AXSubrole" : "AXCloseButton",
com.github.Electron.14328 ||| "AXTitle" : null,
com.github.Electron.14328 ||| "AXTopLevelUIElement" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
com.github.Electron.14328 ||| "AXWindow" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
com.github.Electron.14328 ||| "Aero.AxIgnored" : "AXFrame, AXSize, AXFocused, AXHelp, AXPosition, AXRoleDescription, AXEdited"
com.github.Electron.14328 ||| },
com.github.Electron.14328 ||| "AXDefaultButton" : null,
com.github.Electron.14328 ||| "AXDocument" : "",
com.github.Electron.14328 ||| "AXFocused" : 0,
com.github.Electron.14328 ||| "AXFrame" : "<AXValue 0x60000285d100> {value = x:1512.000000 y:-490.000000 w:1920.000000 h:1079.000000 type = kAXValueCGRectType}",
com.github.Electron.14328 ||| "AXFullScreen" : 0,
com.github.Electron.14328 ||| "AXFullScreenButton" : {
com.github.Electron.14328 ||| "AXEnabled" : 1,
com.github.Electron.14328 ||| "AXParent" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
com.github.Electron.14328 ||| "AXRole" : "AXButton",
com.github.Electron.14328 ||| "AXSubrole" : "AXFullScreenButton",
com.github.Electron.14328 ||| "AXTitle" : null,
com.github.Electron.14328 ||| "AXTopLevelUIElement" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
com.github.Electron.14328 ||| "AXWindow" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
com.github.Electron.14328 ||| "Aero.AxIgnored" : "AXFrame, AXSize, AXFocused, AXChildren, AXHelp, AXPosition, AXRoleDescription"
com.github.Electron.14328 ||| },
com.github.Electron.14328 ||| "AXGrowArea" : null,
com.github.Electron.14328 ||| "AXMain" : 1,
com.github.Electron.14328 ||| "AXMinimizeButton" : {
com.github.Electron.14328 ||| "AXEnabled" : 1,
com.github.Electron.14328 ||| "AXParent" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
com.github.Electron.14328 ||| "AXRole" : "AXButton",
com.github.Electron.14328 ||| "AXSubrole" : "AXMinimizeButton",
com.github.Electron.14328 ||| "AXTitle" : null,
com.github.Electron.14328 ||| "AXTopLevelUIElement" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
com.github.Electron.14328 ||| "AXWindow" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
com.github.Electron.14328 ||| "Aero.AxIgnored" : "AXFrame, AXSize, AXFocused, AXHelp, AXPosition, AXRoleDescription"
com.github.Electron.14328 ||| },
com.github.Electron.14328 ||| "AXMinimized" : 0,
com.github.Electron.14328 ||| "AXModal" : 0,
com.github.Electron.14328 ||| "AXParent" : "<AXUIElement Application 0x6000033bf8d0> {pid=41689}",
com.github.Electron.14328 ||| "AXPosition" : "<AXValue 0x6000033db780> {value = x:1512.000000 y:-490.000000 type = kAXValueCGPointType}",
com.github.Electron.14328 ||| "AXProxy" : null,
com.github.Electron.14328 ||| "AXRole" : "AXWindow",
com.github.Electron.14328 ||| "AXSections" : [
com.github.Electron.14328 ||| "{\n SectionDescription = Content;\n SectionObject = \"<AXUIElement 0x6000033ef8a0> {pid=41689}\";\n SectionUniqueID = AXContent;\n}",
com.github.Electron.14328 ||| "{\n SectionObject = \"<AXUIElement 0x6000033ee670> {pid=41689}\";\n SectionUniqueID = AXContainer;\n}"
com.github.Electron.14328 ||| ],
com.github.Electron.14328 ||| "AXSize" : "<AXValue 0x6000033bf8d0> {value = w:1920.000000 h:1079.000000 type = kAXValueCGSizeType}",
com.github.Electron.14328 ||| "AXSubrole" : "AXStandardWindow",
com.github.Electron.14328 ||| "AXTitle" : "Foo",
com.github.Electron.14328 ||| "AXTitleUIElement" : null,
com.github.Electron.14328 ||| "AXToolbarButton" : null,
com.github.Electron.14328 ||| "AXZoomButton" : {
com.github.Electron.14328 ||| "AXEnabled" : 1,
com.github.Electron.14328 ||| "AXParent" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
com.github.Electron.14328 ||| "AXRole" : "AXButton",
com.github.Electron.14328 ||| "AXSubrole" : "AXFullScreenButton",
com.github.Electron.14328 ||| "AXTitle" : null,
com.github.Electron.14328 ||| "AXTopLevelUIElement" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
com.github.Electron.14328 ||| "AXWindow" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
com.github.Electron.14328 ||| "Aero.AxIgnored" : "AXFrame, AXSize, AXFocused, AXChildren, AXHelp, AXPosition, AXRoleDescription"
com.github.Electron.14328 ||| },
com.github.Electron.14328 ||| "Aero.AXApp" : {
com.github.Electron.14328 ||| "AXExtrasMenuBar" : null,
com.github.Electron.14328 ||| "AXFocusedUIElement" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWebArea\", subrole=nil)",
com.github.Electron.14328 ||| "AXFocusedWindow" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
com.github.Electron.14328 ||| "AXFrame" : null,
com.github.Electron.14328 ||| "AXFrontmost" : 1,
com.github.Electron.14328 ||| "AXFunctionRowTopLevelElements" : [
com.github.Electron.14328 |||
com.github.Electron.14328 ||| ],
com.github.Electron.14328 ||| "AXMainWindow" : "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")",
com.github.Electron.14328 ||| "AXManualAccessibility" : 0,
com.github.Electron.14328 ||| "AXMenuBar" : "<AXUIElement 0x6000033ec270> {pid=41689}",
com.github.Electron.14328 ||| "AXPosition" : null,
com.github.Electron.14328 ||| "AXRole" : "AXApplication",
com.github.Electron.14328 ||| "AXSize" : null,
com.github.Electron.14328 ||| "AXTitle" : "Electron",
com.github.Electron.14328 ||| "AXWindows" : [
com.github.Electron.14328 ||| "AXUIElement(AxWindowId=14328, title=\"Foo\", role=\"AXWindow\", subrole=\"AXStandardWindow\")"
com.github.Electron.14328 ||| ],
com.github.Electron.14328 ||| "Aero.AxIgnored" : "AXChildren, AXChildrenInNavigationOrder, AXEnhancedUserInterface, AXPreferredLanguage, AXRoleDescription, AXHidden"
com.github.Electron.14328 ||| },
com.github.Electron.14328 ||| "Aero.App.appBundleId" : "com.github.Electron",
com.github.Electron.14328 ||| "Aero.App.nsApp.activationPolicy" : "regular",
com.github.Electron.14328 ||| "Aero.App.nsApp.execPath" : "file:///redacted/path",
com.github.Electron.14328 ||| "Aero.App.version" : "36.4.0",
com.github.Electron.14328 ||| "Aero.App.versionShort" : "36.4.0",
com.github.Electron.14328 ||| "Aero.AxIgnored" : "AXChildrenInNavigationOrder, AXChildren, AXRoleDescription",
com.github.Electron.14328 ||| "Aero.AxUiElementWindowType" : "window",
com.github.Electron.14328 ||| "Aero.AxUiElementWindowType_isDialogHeuristic" : false,
com.github.Electron.14328 ||| "Aero.axWindowId" : 14328,
com.github.Electron.14328 ||| "Aero.macOS.version" : "Version 15.5 (Build 24F74)",
com.github.Electron.14328 ||| "Aero.on-window-detected" : [
com.github.Electron.14328 ||| {
com.github.Electron.14328 ||| "commands" : "move-node-to-workspace D",
com.github.Electron.14328 ||| "matcher" : "appId=\"com.github.Electron\""
com.github.Electron.14328 ||| }
com.github.Electron.14328 ||| ],
com.github.Electron.14328 ||| "Aero.treeNodeParent" : "Optional(AppBundle.TilingContainer)",
com.github.Electron.14328 ||| "Aero.workspace" : "T"
com.github.Electron.14328 ||| }When the issue occurs, the Electron window seems to briefly flash in and spawn in the correct workspace, and then moves immediately to the currently focused workspace The secondary odd behaviour of this is that the new window is drawn on top of other apps and looks like it has focus, but it doesn't - as soon as I run a focus command it acts as if my previous window (terminal in this case) was still focused instead |
Beta Was this translation helpful? Give feedback.
-
|
I have no clue. You are welcome to build from sources and debug the problem yourself. Here is the place where you can start diff --git a/Sources/AppBundle/tree/MacWindow.swift b/Sources/AppBundle/tree/MacWindow.swift
index a23f45fc..b3b2b0f9 100644
--- a/Sources/AppBundle/tree/MacWindow.swift
+++ b/Sources/AppBundle/tree/MacWindow.swift
@@ -35,6 +35,7 @@ final class MacWindow: Window {
try await debugWindowsIfRecording(window)
if try await !restoreClosedWindowsCacheIfNeeded(newlyDetectedWindow: window) {
+ // Put breakpoint here
try await tryOnWindowDetected(window)
}
return window
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Body
I have this bit of config;
so when I run a local dev build of an Electron app it should be sent to workspace D. This used to work consistently (I think on version 0.16) but since then I have found around 50% of the time when a new Electron window is created, it appears in the currently focused workspace and the callback doesn't move it to workspace D.
I'm not sure how best to debug this flakiness and get a consistent repro but happy to try if someone can point me in the right direction.
I have not seen this behavior with any of my other apps or [[on-window-detected]] callbacks.
Expected result: consistent workspace assignment
Actual result: inconsistency, sometimes it works and sometimes the new Electron window stays in the currently focused workspace
Additional info
Beta Was this translation helpful? Give feedback.
All reactions