~ubuntu-branches/ubuntu/lucid/sawfish/lucid-updates

« back to all changes in this revision

Viewing changes to lisp/sawfish/wm/placement/smart.jl

  • Committer: Bazaar Package Importer
  • Author(s): Christian Marillat
  • Date: 2005-02-23 16:16:46 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050223161646-4id6qyw4h9lkvb0v
Tags: 1:1.3+cvs20050222-1
* New cvs release.
* Add an emacs initialisation script to load sawfish.el (Closes: #295290)
* Updated sawfish.el to 1.32

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
;; smart-placement.jl -- ``intelligent'' window placement
2
 
;; $Id: smart.jl,v 1.46 2001/12/18 01:35:28 federico Exp $
 
2
;; $Id: smart.jl,v 1.50 2002/07/01 03:07:18 jsh Exp $
3
3
 
4
4
;; Copyright (C) 1999 John Harper <john@dcs.warwick.ac.uk>
5
5
 
52
52
    (open rep
53
53
          sawfish.wm.util.rects
54
54
          sawfish.wm.util.groups
 
55
          sawfish.wm.util.workarea
55
56
          sawfish.wm.windows
56
57
          sawfish.wm.misc
57
58
          sawfish.wm.events
58
59
          sawfish.wm.placement
59
60
          sawfish.wm.custom
60
 
          sawfish.wm.workspace
61
 
          sawfish.wm.state.maximize)
 
61
          sawfish.wm.workspace)
62
62
 
63
63
 
64
64
;;; options/variables
66
66
  (defvar sp-avoided-windows-weight 100)
67
67
  (defvar sp-normal-windows-weight 1)
68
68
 
69
 
  (defcustom sp-padding 4
70
 
    "Try to leave at least this many pixels between window edges in first/best-fit."
71
 
    :group placement
72
 
    :type (number 0 64)
73
 
    :user-level expert)
 
69
  (defvar sp-padding 0
 
70
    "Try to leave at least this many pixels between window edges in first/best-fit.")
74
71
 
75
72
  ;; the maximum number of points to keep in each grid dimension
76
73
  (defvar sp-max-points 10)
380
377
                             (t sp-normal-windows-weight)))))
381
378
             (grid (sp-make-grid rects t))
382
379
             (dims (window-frame-dimensions w))
383
 
             (workarea (maximize-find-workarea w #:head-fallback t))
 
380
             (workarea (calculate-workarea #:window w))
384
381
             (workarea-width (- (nth 2 workarea) (nth 0 workarea)))
385
382
             (workarea-height (- (nth 3 workarea) (nth 1 workarea)))
386
383
             point)
425
422
;;; init
426
423
 
427
424
  ;;###autoload
428
 
  (define-placement-mode 'first-fit place-window-first-fit)
 
425
  (define-placement-mode 'first-fit place-window-first-fit #:for-normal t)
429
426
  (define-placement-mode 'best-fit place-window-best-fit)
430
427
  (define-placement-mode 'best-fit-group place-window-best-fit-group)
431
428
  (define-placement-mode 'first-fit-or-interactive place-window-first-fit-or-interactive))