finagle the fenestra#
Thu, 24 Oct 2013 23:32:20 +0000
So I have a working laptop again, but the touchpad has a frankly rather stupid "touch then drag" behaviour that makes window placement an absolute pain. In my lunch hour yesterday, lacking the internet access I needed to address the Clojure issue that I had originally holed up in the Barbican library to work on (couldn't get a 3G or a wireless connection) I decided to look again at last year's 'throw-window' sawfish hackery , and have turned it into something slightly more useful: now instead of slinging the focused window all the way to the screen edge it only moves it to butt up against the next window on the screen (more precisely, it moves to align with the lext or right border of teh next window along).
The code is at https://github.com/telent/dotfiles/blob/master/.sawfish/lisp/throw-window.jl (i.e. it hasn't moved) and there are a couple of other changes
- it's now a module, which required some experimentation as the
documentation is a bit more abstract and less concrete than I'd
like. Note that
- The entire file is now inside the body of the
define-structure
form - The symbols in the
export
clause can now be referenced, as written, in (what for want of a keener understanding of how it actually works I am calling) the global environment. By which I mean to say, we call the function from outside the module asthrow-window-down
not asthrow-window.throw-window-down
- the command names didn't need exporting but are nevertheless globally available anyway. Don't ask me why.
- The entire file is now inside the body of the
-
do-move
has been enhanced with a call towindow-frame-offset
so that the pointer is warped to where we actually were relative to the window contents instead of being off by the size of the titlebar/left border.