sawfish r4278 - in branches/sawfish-experimental: . lisp/sawfish/wm
- From: jkozicki svn gnome org
- To: svn-commits-list gnome org
- Subject: sawfish r4278 - in branches/sawfish-experimental: . lisp/sawfish/wm
- Date: Wed, 17 Sep 2008 15:48:15 +0000 (UTC)
Author: jkozicki
Date: Wed Sep 17 15:48:15 2008
New Revision: 4278
URL: http://svn.gnome.org/viewvc/sawfish?rev=4278&view=rev
Log:
apply Scroll viewport by Fernando Carmona Varo (script by Andreas Bombe)
Modified:
branches/sawfish-experimental/ChangeLog
branches/sawfish-experimental/THANKS
branches/sawfish-experimental/lisp/sawfish/wm/viewport.jl
Modified: branches/sawfish-experimental/THANKS
==============================================================================
--- branches/sawfish-experimental/THANKS (original)
+++ branches/sawfish-experimental/THANKS Wed Sep 17 15:48:15 2008
@@ -6,9 +6,11 @@
(A..Z)
- Andrea Vettorello for a lot of wok on wiki and several patches
+ - Andreas Bombe for original script in Scroll viewport patch
- Christopher Bratusek for numerous patches & cleanup and other active contribution
- Dagfinn I. Mannsake for enter-click focus mode patch and xterm command patch
- Derek Upham for his documentation
+ - Fernando Carmona Varo for Scroll viewport patch
- Fuchur for xinerama placement patch
- GSR for patches and other active contribution
- Harald van Dijk for QT menu focus patch, titlebar updates and parallel make
Modified: branches/sawfish-experimental/lisp/sawfish/wm/viewport.jl
==============================================================================
--- branches/sawfish-experimental/lisp/sawfish/wm/viewport.jl (original)
+++ branches/sawfish-experimental/lisp/sawfish/wm/viewport.jl Wed Sep 17 15:48:15 2008
@@ -55,6 +55,12 @@
(defvar uniconify-to-current-viewport t
"Windows uniconify to the current viewport.")
+
+ (defcustom scroll-viewport-steps 5
+ "Number of steps in which to scroll between viewports (less steps = faster scrolling)."
+ :group workspace
+ :type number
+ :range (1 . 100))
;;; raw viewport handling
@@ -62,7 +68,8 @@
(defvar viewport-x-offset 0)
(defvar viewport-y-offset 0)
- (define (set-viewport x y)
+ (define (warp-viewport x y)
+ "Change view by incrementing the coordinates of the x,y position."
;; move W to its new position
(define (move-window w)
(unless (window-get w 'sticky-viewport)
@@ -92,6 +99,19 @@
(setq viewport-y-offset y)
(call-hook 'viewport-moved-hook)))
+ (define (set-viewport x y)
+ "Scroll viewport view by incrementing the coordinates of the x,y position.
+The scrolling makes a number of increments equal to `scroll-viewport-steps'."
+ (let ((step-count scroll-viewport-steps)
+ (xstep (quotient (- x viewport-x-offset) scroll-viewport-steps))
+ (ystep (quotient (- y viewport-y-offset) scroll-viewport-steps)))
+ (when (= xstep ystep 0)
+ (setq step-count 0))
+ (while (> step-count 1)
+ (warp-viewport (+ viewport-x-offset xstep) (+ viewport-y-offset ystep))
+ (setq step-count (1- step-count)))
+ (warp-viewport x y)))
+
(define (viewport-before-exiting)
(set-screen-viewport 0 0))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]