GNOME Bugzilla – Bug 137772
Improved extensibility for window order
Last modified: 2009-12-19 07:13:28 UTC
[I directed this to the sawfish mailing list in the beginning of February but got no answer, so I'm now filing it in Bugzilla so that it doesn't get lost.] I wanted to implement my own window order algorithm (based on window position instead of an MRU stack). This turned out to be a bit awkward since it requires me to override the whole x-cycle package with my own, which would basically just be a copy. The code is nicely abstracted into cycling in commands/x-cycle.jl and window order stuff in util/window-order.jl, but the problem is that window-order.jl provides no way to hook in a custom window order function. The attached patch adds that to window-order.jl. The hook-in code is more or less ripped from placement.jl but without the autoload stuff which I haven't figured out. The patch also fixes a bug in x-cycle.jl which appeared when I used my own window order: In one place it assumed that MRU order is used and simply added the currently focused window to the front of the order. To avoid clumsy code I split up the window-order function into two: One that gets the window list to order (get-windows-to-order) and another one that does the actual sorting (sort-windows-in-order). The patch includes a fix for another minor bug in x-cycle.jl (sorry for mixing it together): When focusing a window it did not call warp-pointer-if-necessary which had the effect that warp-to-window-enabled wasn't heeded by the x-cycle package. (A little bit of refactoring between that code and activate-window in windows.jl is probably in order to avoid this kind of bug in the future.) Can this patch or something like it get in? I'd like to know so I can make my window order package available using a supported API.
Created attachment 25829 [details] [review] Patch for better extensibility of window order code (and some minor bug fixes)
If you still want your patch to get part of Sawfish split the bugfixes and the new functions. And then put both patches to Sawfish's new homepage: http://sawfish.wikia.com
OBSOLETE