New window opened by your extension is moved to be under mouse cursor, great, as it reduces mouse travel distance.
Problem is I already have another extension installed for similar functionality (reducing mouse travel distance) by moving cursor to follow window focus, and these two seems to be conflicting:
My mouse is at the right side of the screen
A new window gets created with Fly-Pie menu, it initially opens at the left side of the screen
My extension detects focus change and moves mouse to the left side of the screen
Fly-Pie detects the window is opened and moves the window to the right side of the screen
My cursor is at left side while the window is at right side
The Solution
The Easy Way: Add a toggle to disable the window movement behavior (to not move the newly created window).
The Alternatives
The Moderate Way: Add more checks before moving the window: Don't move window if cursor is already within window border and don't store cursor position if it's not used immediately. This might add a small overhead that you have a few more lines of code to run for a time sensitive task and race condition is still present, just that it's harder to trigger.
The Hard Way: Attempt to fix the race condition by implementing a streamlined method to define/check new window placement property, this would require adaption from conflicting extensions as well and it's far out of Fly-Pie's scope.
The Brutal Way: Merge Mouse Follows Focus main functionality into Fly-Pie and make sure it doesn't conflict, it's again out of Fly-Pie's scope.
The Motivation
New window opened by your extension is moved to be under mouse cursor, great, as it reduces mouse travel distance.
Problem is I already have another extension installed for similar functionality (reducing mouse travel distance) by moving cursor to follow window focus, and these two seems to be conflicting:
The Solution
The Easy Way: Add a toggle to disable the window movement behavior (to not move the newly created window).
The Alternatives
The Moderate Way: Add more checks before moving the window: Don't move window if cursor is already within window border and don't store cursor position if it's not used immediately. This might add a small overhead that you have a few more lines of code to run for a time sensitive task and race condition is still present, just that it's harder to trigger. The Hard Way:
Attempt to fix the race condition by implementing a streamlined method to define/check new window placement property, this would require adaption from conflicting extensions as well andit's far out of Fly-Pie's scope. The Brutal Way:Merge Mouse Follows Focus main functionality into Fly-Pie and make sure it doesn't conflict, it's again out of Fly-Pie's scope.