Schneegans / Fly-Pie

:pie: Fly-Pie is an innovative marking menu written as a GNOME Shell extension.
http://schneegans.github.io/news/2021/12/02/flypie10
MIT License
1.21k stars 26 forks source link

Allow disabling the movement of newly created window to be under cursor #253

Closed ghost closed 1 year ago

ghost commented 2 years ago

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 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.

ghost commented 2 years ago

It's also conflicting with Highlight Focus.

Schneegans commented 2 years ago

Thanks for the suggestion! Adding this as an option is definitely very easy. I will do this for the next release!