Wikia

Sawfish

Sawfish UI Rework

773pages on
this wiki
Talk0
Browse all patches

Author Edit

Christopher Bratusek

Synopsis Edit

We discussed about a new sawfish-ui, but this will take longer ... So I'm going to optimize what we actually have. And this is the result. Tell me what you think.

  • Currently the TreeView only listens to double-clicks, does anyone know, how to make it listen to single-clicks?


Patch testing Edit

  1. Copy/paste the patch listed below into some file, eg. TEST.diff.
  2. If you don't have sawfish sources yet, have one, as described get it from GIT repo.
  3. Go into the directory where sawfish sources reside, eg. cd sawfish
  4. Test if the patch applies cleanly with this command:
    patch -p1 --ignore-whitespace --dry-run < TEST.diff
    in case of problems try also: -p0 or -p2
  5. If it applies cleanly, then remove the --dry-run from above command and run it again, otherwise ask on the mailing list.
  6. Compile sawfish: ./autogen.sh && make
  7. Install it for testing, but it depends on your linux distribution.
    1. It is always better to install sawfish as your distribution package, but it is different for each distribution.
    2. So you may try make install, which will install sawifish in /usr/local/share/sawfish/ (if you have write access). But then make sure that you run the correct version and delete it from that directory afterwards, to avoid any conflicts.
  8. Se also

PS: edit this template if you feel that those instructions can be improved.

Patch Edit

Index: lisp/sawfish/wm/animation/outline.jl
===================================================================
--- lisp/sawfish/wm/animation/outline.jl	(Revision 4299)
+++ lisp/sawfish/wm/animation/outline.jl	(Arbeitskopie)
@@ -28,16 +28,29 @@
 	  sawfish.wm.events
 	  sawfish.wm.windows
 	  sawfish.wm.window-anim
+	  sawfish.wm.custom
 	  sawfish.wm.util.window-outline
 	  rep.io.timers)
 
   (define-structure-alias anim-outline sawfish.wm.animation.outline)
 
-  (defvar anim-outline-icon-coords (cons (screen-width) (screen-height)))
+  (defcustom anim-outline-icon-coords '(cons (screen-width) (screen-height))
+    "Animation Outline Coordinates"
+    :type (pair (number 1) (number 1))
+    :group (appearance animation))
 
-  (defvar anim-outline-steps 16)
-  (defvar anim-outline-delay 20)
+  (defcustom anim-outline-steps 16
+    "Animation Steps"
+    :type number
+    :group (appearance animation)
+    :range ( 1 . 1000 ))
 
+  (defcustom anim-outline-delay 20
+    "Animation Delay"
+    :type number
+    :group (appearance animation)
+    :range ( 1 . 1000 ))
+
   (define (anim-outline-run w mode initial-coords initial-dims
 			    final-coords final-dims)
     (let ((step 0)
Index: lisp/sawfish/wm/frames.jl
===================================================================
--- lisp/sawfish/wm/frames.jl	(Revision 4301)
+++ lisp/sawfish/wm/frames.jl	(Arbeitskopie)
@@ -142,7 +142,7 @@
   (defcustom reload-themes-when-changed t
     "Automatically reload themes when they are updated."
     :type boolean
-    :group misc)
+    :group appearance)
 
   (defvar frame-type-fallback-alist
     '((transient . default)
Index: lisp/sawfish/wm/ext/edge-flip.jl
===================================================================
--- lisp/sawfish/wm/ext/edge-flip.jl	(Revision 4299)
+++ lisp/sawfish/wm/ext/edge-flip.jl	(Arbeitskopie)
@@ -66,8 +66,12 @@
     :group (workspace edge-flip)
     :after-set (lambda () (edge-flip-enable)))
 
-  (defvar edge-flip-delay 250
-    "Milliseconds to delay before edge flipping.")
+  (defcustom edge-flip-delay 250
+    "Milliseconds to delay before edge flipping."
+    :type number
+    :depends edge-flip-enabled
+    :group (workspace edge-flip)
+    :after-set (lambda () (edge-flip-enable)))
 
   (define ef-current-edge nil)
   (define ef-timer nil)
Index: lisp/sawfish/wm/ext/tooltips.jl
===================================================================
--- lisp/sawfish/wm/ext/tooltips.jl	(Revision 4299)
+++ lisp/sawfish/wm/ext/tooltips.jl	(Arbeitskopie)
@@ -31,6 +31,7 @@
 	  rep.io.timers
 	  sawfish.wm.commands
 	  sawfish.wm.custom
+	  sawfish.wm.colors
 	  sawfish.wm.misc
 	  sawfish.wm.windows
 	  sawfish.wm.frames
@@ -41,38 +42,53 @@
 
   (define tooltips-timer nil)
 
-  ;;###autoload (defgroup tooltips "Tooltips" :group misc :require sawfish.wm.ext.tooltips)
+  ;;###autoload (defgroup tooltips "Tooltips" :group appearance :require sawfish.wm.ext.tooltips)
 
   (defgroup tooltips "Tooltips"
-    :group misc
+    :group appearance
     :require sawfish.wm.ext.tooltips)
 
   (defcustom tooltips-enabled nil
     "Display tooltips for window frames."
     :type boolean
-    :group (misc tooltips)
+    :group (appearance tooltips)
     :require sawfish.wm.ext.tooltips)
 
   (defcustom tooltips-show-doc-strings nil
     "Show full documentation in tooltips."
     :type boolean
     :depends tooltips-enabled
-    :group (misc tooltips))
+    :group (appearance tooltips))
 
-  (defvar tooltips-delay 500
-    "Number of milliseconds before displaying tooltips.")
+  (defcustom tooltips-delay 500
+    "Number of milliseconds before displaying tooltips."
+    :type number
+    :depends tooltips-enabled
+    :group (appearance tooltips))
 
-  (defvar tooltips-timeout-delay 5000
-    "Number of milliseconds before removing tooltips.")
+  (defcustom tooltips-timeout-delay 5000
+    "Number of milliseconds before removing tooltips."
+    :type number
+    :depends tooltips-enabled
+    :group (appearance tooltips))
 
-  (defvar tooltips-font nil
-    "Font used to display tooltips, or nil for default.")
+  (defcustom tooltips-font default-font
+    "Font used to display tooltips, or nil for default."
+    :type font
+    :depends tooltips-enabled
+    :group (appearance tooltips))
 
-  (defvar tooltips-background-color "grey85"
-    "Color used for the tooltips background")
+  (defcustom tooltips-background-color "grey85"
+    "Color used for the tooltips background"
+    :type color
+    :depends tooltips-enabled
+    :group (appearance tooltips))
 
-  (defvar tooltips-foreground-color "black"
-    "Color used for the tooltips foreground")
+  (defcustom tooltips-foreground-color "black"
+    "Color used for the tooltips foreground"
+    :type color
+    :depends tooltips-enabled
+    :group (appearance tooltips))
 
 ;;; displaying tooltips
 
Index: lisp/sawfish/wm/ext/window-history.jl
===================================================================
--- lisp/sawfish/wm/ext/window-history.jl	(Revision 4301)
+++ lisp/sawfish/wm/ext/window-history.jl	(Arbeitskopie)
@@ -87,29 +87,29 @@
 
 ;;; customizations
 
-  (defgroup window-history "History" :group misc)
+  (defgroup window-history "History" :group match-window)
 
   (defcustom window-history-auto-save-position t
     "Automatically remember window positions."
-    :group (misc window-history)
+    :group (match-window window-history)
     :type boolean
     :require sawfish.wm.ext.window-history)
 
   (defcustom window-history-auto-save-dimensions nil
     "Automatically remember window sizes."
-    :group (misc window-history)
+    :group (match-window window-history)
     :type boolean
     :require sawfish.wm.ext.window-history)
 
   (defcustom window-history-auto-save-state nil
     "Automatically remember other window attributes."
-    :group (misc window-history)
+    :group (match-window window-history)
     :type boolean
     :require sawfish.wm.ext.window-history)
 
   (defcustom window-history-ignore-transients t
     "Don't automatically remember details of transient windows."
-    :group (misc window-history)
+    :group (match-window window-history)
     :type boolean)
 
 ;;; matching windows
Index: lisp/sawfish/wm/workspace.jl
===================================================================
--- lisp/sawfish/wm/workspace.jl	(Revision 4301)
+++ lisp/sawfish/wm/workspace.jl	(Arbeitskopie)
@@ -118,13 +118,15 @@
 
 ;;; Options and variables
 
-  (defvar workspace-boundary-mode 'stop
-    "How to act when passing the first or last workspace, one of `stop',
-`wrap-around' or `keep-going'")
+  (defcustom workspace-boundary-mode 'stop
+    "How to act when passing the first or last workspace."
+    :type (choice stop wrap-around keep-going)
+    :group workspace)
 
-  (defvar workspace-send-boundary-mode 'stop
-    "How to act when passing the first or last workspace, while moving a
-window, one of `stop', `keep-going', `wrap-around'")
+  (defcustom workspace-send-boundary-mode 'stop
+    "How to act when passing the first or last workspace, while moving a window"
+    :type (choice stop wrap-around keep-going)
+    :group workspace)
 
   (defcustom workspace-names nil
     nil
@@ -133,8 +135,10 @@
     :widget-flags (expand-vertically)
     :after-set (lambda () (workspace-names-changed)))
 
-  (defvar lock-first-workspace t
-    "Preserve outermost empty workspaces in the pager.")
+  (defcustom lock-first-workspace t
+    "Preserve outermost empty workspaces in the pager."
+    :type boolean
+    :group workspace)
 
   ;; Currently active workspace, an integer
   (define current-workspace 0)
Index: lisp/sawfish/wm/placement.jl
===================================================================
--- lisp/sawfish/wm/placement.jl	(Revision 4301)
+++ lisp/sawfish/wm/placement.jl	(Arbeitskopie)
@@ -40,15 +40,17 @@
   (defcustom place-window-mode 'top-left
     "Method of placing windows: \\w"
     :type symbol
-    :group placement)
+    :group (misc placement))
 
   (defcustom place-transient-mode 'centered-on-parent
     "Method of placing dialog windows: \\w"
     :type symbol
-    :group placement)
+    :group (misc placement))
 
-  (defvar ignore-program-positions t
-    "Ignore program-specified window placements.")
+  (defcustom ignore-program-positions t
+    "Ignore program-specified window placements."
+    :type boolean
+    :group (misc placement))
 
   (defvar placement-modes '()
     "List of names of all placement modes.")
Index: lisp/sawfish/wm/custom.jl
===================================================================
--- lisp/sawfish/wm/custom.jl	(Revision 4301)
+++ lisp/sawfish/wm/custom.jl	(Arbeitskopie)
@@ -481,12 +481,12 @@
 
   (defgroup focus "Focus")
   (defgroup move "Move/Resize" :require sawfish.wm.commands.move-resize)
-  (defgroup placement "Placement")
   (defgroup appearance "Appearance")
   (defgroup workspace "Workspaces")
   (defgroup bindings "Bindings")
-  (defgroup min-max "Minimizing and Maximizing")
+  (defgroup min-max "Mini/Maximizing")
   (defgroup misc "Miscellaneous")
+  (defgroup placement "Placement" :group misc)
 
 ;;; loading user's customisations
 
Index: lisp/sawfish/wm/viewport.jl
===================================================================
--- lisp/sawfish/wm/viewport.jl	(Revision 4301)
+++ lisp/sawfish/wm/viewport.jl	(Arbeitskopie)
@@ -50,12 +50,19 @@
   ;; the screen dimensions. E.g. moving to the left moves all windows one
   ;; screen-width to the right. 
 
-  (defvar viewport-dimensions '(1 . 1)
-    "Size of each virtual workspace.")
+  (defgroup viewport "Viewport" :group workspace)
 
-  (defvar uniconify-to-current-viewport t
-    "Windows uniconify to the current viewport.")
+  (defcustom viewport-dimensions '(1 . 1)
+    "Number of columns and rows in each virtual workspace: \\w"
+    :group (workspace viewport)
+    :type (pair (number 1) (number 1))
+    :after-set (lambda () (viewport-size-changed)))
 
+  (defcustom uniconify-to-current-viewport t
+    "Windows uniconify to the current viewport."
+    :type boolean
+    :group (workspace viewport))
+
   (defcustom scroll-viewport-steps 1
     "Number of steps in which to scroll between viewports (less steps = faster scrolling)."
     :group workspace
Index: lisp/sawfish/wm/focus.jl
===================================================================
--- lisp/sawfish/wm/focus.jl	(Revision 4301)
+++ lisp/sawfish/wm/focus.jl	(Arbeitskopie)
@@ -56,12 +56,15 @@
     :type boolean
     :group focus)
 
-  (defvar focus-dont-push nil
-    "When true, focusing a window doesn't change it's position in the stack of
-most-recently focused windows.")
+  (defcustom focus-dont-push nil
+    "Wether focusing a window doesn't change it's position in the stack."
+    :type boolean
+    :group focus)
 
-  (defvar focus-ignore-pointer-events nil
-    "When true, pointer in/out events don't cause focus changes.")
+  (defcustom focus-ignore-pointer-events nil
+    "When true, pointer in/out events don't cause focus changes."
+    :type boolean
+    :group focus)
 
   (define focus-within-click-event (make-fluid nil)
     "When true, the current command is being called from within a
Index: lisp/sawfish/wm/window-anim.jl
===================================================================
--- lisp/sawfish/wm/window-anim.jl	(Revision 4299)
+++ lisp/sawfish/wm/window-anim.jl	(Arbeitskopie)
@@ -37,11 +37,12 @@
   (define window-animators nil
     "List of all possible window animation types.")
 
-  ;; this used to be a defcustom, and I don't have anything against
-  ;; that, except the current animations are so lame it's embarassing
+  (defgroup animation "Animation" :group appearance)
 
-  (defvar default-window-animator 'none
-    "The default window animation mode")
+  (defcustom default-window-animator 'none
+    "The default window animation mode"
+    :type (choice none solid wireframe)
+    :group (appearance animation))
 
 ;;; animator registration
 
Index: lisp/sawfish/wm/windows.jl
===================================================================
--- lisp/sawfish/wm/windows.jl	(Revision 4301)
+++ lisp/sawfish/wm/windows.jl	(Arbeitskopie)
@@ -68,25 +68,39 @@
 	  sawfish.wm.misc
 	  sawfish.wm.commands)
 
-  (defvar ignore-window-input-hint nil
-    "Give focus to windows even when they haven't asked for it.")
 
-  (defvar warp-to-window-offset (cons -1 -1)
-    "Offset (%) from window edges when warping pointer. A negative number
-means outside the left window edge.")
+  (defcustom ignore-window-input-hint nil
+    "Give focus to windows even when they haven't asked for it."
+    :type boolean
+    :group focus)
 
-  (defvar warp-to-window-enabled nil
-    "When false, disable warping the cursor to windows.")
- 
-  (defvar dont-avoid-ignored t
-    "When non-nil, ignored windows aren't avoided by default.")
+  (defgroup warp "Warping" :group misc)
 
-  (defvar avoid-by-default nil
-    "When non-nil, any unspecified windows are avoided by default.")
+  (defcustom warp-to-window-offset (cons -1 -1)
+    "Offset (%) from window edges when warping pointer."
+    :type (pair (number 1) (number 1))
+    :group (misc warp))
 
-  (defvar uniquify-name-format "%s [%d]"
-    "Format to create unique window names.")
+  (defcustom warp-to-window-enabled nil
+    "Wether to enable warping the cursor to windows."
+    :type boolean
+    :group (misc warp))
 
+  (defcustom dont-avoid-ignored t
+    "Wether to not ignore avoided windows by default."
+    :type boolean
+    :group misc)
+
+  (defcustom avoid-by-default nil
+    "Wether to avoid any unspecified window by default."
+    :type boolean
+    :group misc)
+
+  (defcustom uniquify-name-format "%s [%d]"
+    "Format to create unique window names."
+    :type string
+    :group misc)
+
   (defvar dock-window-properties
     '(window-list-skip cycle-skip fixed-position focus-click-through
       avoid no-history never-iconify never-maximize sticky
Index: lisp/sawfish/wm/commands/move-cursor.jl
===================================================================
--- lisp/sawfish/wm/commands/move-cursor.jl	(Revision 4299)
+++ lisp/sawfish/wm/commands/move-cursor.jl	(Arbeitskopie)
@@ -30,7 +30,7 @@
 	  sawfish.wm.commands)
 
   (defcustom move-cursor-increment 16
-    "Number of pixels to move pointer in `move-cursor-' commands."
+    "Number of pixels to move pointer in."
     :group misc
     :type (number 1))
 
Index: lisp/sawfish/wm/commands/x-cycle.jl
===================================================================
--- lisp/sawfish/wm/commands/x-cycle.jl	(Revision 4301)
+++ lisp/sawfish/wm/commands/x-cycle.jl	(Arbeitskopie)
@@ -119,8 +119,10 @@
     :group (focus cycle)
     :type boolean)
 
-  (defvar cycle-raise-windows t
-    "Raise windows while they're temporarily selected during cycling.")
+  (defcustom cycle-raise-windows t
+    "Raise windows while they're temporarily selected during cycling."
+    :type boolean
+    :group (focus cycle))
 
   (defcustom cycle-keymap (make-keymap)
     "Keymap containing bindings active only during window cycling operations."
Index: lisp/sawfish/wm/commands/move-resize.jl
===================================================================
--- lisp/sawfish/wm/commands/move-resize.jl	(Revision 4301)
+++ lisp/sawfish/wm/commands/move-resize.jl	(Arbeitskopie)
@@ -48,15 +48,22 @@
   ;; todo:
   ;;  * obey the aspect ratio size hints
 
-  (defvar move-outline-mode 'opaque
-    "How windows being moved are animated, either `opaque' or `box'")
-  
-  (defvar resize-outline-mode 'opaque
-    "How windows being resized are animated, either `opaque' or `box'")
-  
-  (defvar move-resize-raise-window nil
-    "Raise windows when they are moved or resized.")
-  
+ 
+  (defcustom move-outline-mode 'opaque
+    "How windows being moved are animated"
+    :type (choice opaque box)
+    :group (appearance animation))
+
+  (defcustom resize-outline-mode 'opaque
+    "How windows being resized are animated"
+    :type (choice opaque box)
+    :group (appearance animation))
+
+  (defcustom move-resize-raise-window nil
+    "Raise windows when they are moved or resized."
+    :type boolean
+    :group move)
+
   (defcustom move-show-position nil
     "Show current position of windows while moving."
     :group move
@@ -66,11 +73,12 @@
     "Show current dimensions of windows while resizing."
     :group move
     :type boolean)
+ 
+ (defcustom resize-edge-mode 'border-grab
+   "How to choose window edges when resizing."
+   :type (choice region border grab border-grab)
+   :group move)
   
-  (defvar resize-edge-mode 'border-grab
-    "How to choose window edges when resizing. One of `region', `border',
-`grab', `border-grab'")
-  
   (defcustom move-snap-epsilon 12
     "Distance in pixels before window edges align with each other."
     :group move
Index: lisp/sawfish/wm/util/compat.jl
===================================================================
--- lisp/sawfish/wm/util/compat.jl	(Revision 4299)
+++ lisp/sawfish/wm/util/compat.jl	(Arbeitskopie)
@@ -96,11 +96,9 @@
 
   (mapc (lambda (x)
 	  (put x 'custom-obsolete t))
-	'(viewport-columns viewport-rows viewport-dimensions
+	'(viewport-columns viewport-rows
 	  preallocated-workspaces iconify-whole-group
 	  uniconify-whole-group always-update-frames
-	  cycle-disable-auto-raise cycle-show-window-icons
-	  cycle-warp-pointer cycle-focus-windows cycle-raise-windows
 	  edge-flip-warp-pointer frame-type-fallbacks
 	  warp-to-window-x-offset warp-to-window-y-offset
 	  uniquify-name-format transients-get-focus decorate-transients
@@ -112,21 +110,16 @@
 	  warp-to-selected-windows menus-include-shortcuts
 	  configure-auto-gravity configure-ignore-stacking-requests
 	  beos-window-menu-simplifies customize-show-symbols
-	  tooltips-timeout-enabled tooltips-delay
-	  tooltips-timeout-delay tooltips-font
-	  tooltips-foreground-color tooltips-background-color
 	  move-snap-mode move-snap-ignored-windows
 	  move-resize-inhibit-configure move-snap-edges
 	  raise-windows-when-unshaded persistent-group-ids
 	  delete-workspaces-when-empty transients-on-parents-workspace
-	  edge-flip-delay audio-for-ignored-windows
+	  audio-for-ignored-windows
 	  size-window-def-increment slide-window-increment
 	  default-bevel-percent sp-padding nokogiri-user-level
 	  nokogiri-buttons workspace-boundary-mode
 	  workspace-send-boundary-mode lock-first-workspace
-	  ignore-window-input-hint default-window-animator
-	  resize-edge-mode move-outline-mode resize-outline-mode
-	  move-resize-raise-window workspace-geometry
+	  ignore-window-input-hint workspace-geometry
 	  pointer-motion-threshold ignore-program-positions))
 
 ;;; obsolete custom setters
Index: lisp/sawfish/ui/main.jl.in
===================================================================
--- lisp/sawfish/ui/main.jl.in	(Revision 4299)
+++ lisp/sawfish/ui/main.jl.in	(Arbeitskopie)
@@ -59,8 +59,7 @@
       (setq group (read-from-string group))
       (set-top-group (if (listp group) group `(root ,group)))))
 
-  ;; XXX remove the "or t" when trees work again
-  (when (or t (get-command-line-option "--flatten"))
+  (when (get-command-line-option "--flatten")
     (setq *nokogiri-flatten-groups* t))
 
   (when (get-command-line-option "--single-level")
Index: lisp/sawfish/ui/shell.jl
===================================================================
--- lisp/sawfish/ui/shell.jl	(Revision 4299)
+++ lisp/sawfish/ui/shell.jl	(Arbeitskopie)
@@ -93,7 +93,7 @@
 	      (gtk-container-add vbox paned)
 	      (gtk-paned-add1 paned g-scroller)
 	      (gtk-paned-add2 paned (or s-scroller slot-box-widget))
-	      (gtk-paned-set-position paned 150)
+	      (gtk-paned-set-position paned 250)
 	      (gtk-scrolled-window-add-with-viewport g-scroller
 						     group-tree-widget))
 	  (gtk-container-add vbox (or s-scroller slot-box-widget))))

Community's reasons for inclusion or rejection Edit

Patch submitters, please vote also! Yes, obviously your vote will be positive, but it's the place to give your explanation why this patch is good for all Sawfish users, and why it is correct - good reasons for inclusion.

When voting anonymously please write your name, so that it can be associated with your posts on the mailing list. If you are logged in you can sign yourself by typing four tilda characters: ~~~~.

  • Please vote with: Yes vote: yes., No vote: no., Try vote: let's try in experimental., Wtf vote: pondering. or Suspend wait for next release.
  • Wtf vote: pondering.: Tree-view should be postponed, Others look nice. Thanks a lot!!
    • Tree-view should be postponed, I think, unless double-click goes away, for ordinary users. (It'd be nice if right/left cursor key folds/unfolds the tree, if the tree view becomes the default. :)
       Anyway, when commiting the tree view, OPTIONS and news.texi should tell about 'customize-program' to choose '--flatten'. - Teika kazura 07:30, 4 December 2008 (UTC)
  • No vote: no.: double clicking is completely unobvious, plus the fact that the hierarchy magically appears when you do double click on something (e.g. "Miscellaneous") makes it not very user friendly. In fact, user interface testing has shown that a dialog with tabs is much more user-friendly than this sort of alternative. (Plus from a purely æsthetic POV, I think the linespacing is much too tight on the tree, giving it a busy, ugly appearance.) On top of that, windows tend to have very different sizes, and inefficient and inconsistent use of space (i.e. the same as current, so nothing personal).
    I was pondering that right before I came here, I thought: The Sawfish UI dialog box needs a bit of work, I wonder if there's any work being done on it. My idea had been to create something more like the Gnome Control Panel dialog box with icons which open new (possibly tabbed) windows (a dialog/window version of the menu I see if I middle-click on my desktop and go to the "Customise" submenu, except sized according to the content).
    I might've tried looking at doing something myself, but I probably won't have the time for a few months...
    I hope it's okay for me to vote here, given that I'm just a long-time user who hasn't ever contributed here or elsewhere before.
    Cassowary 11:16, 31 May 2009 (UTC)
- Hi, Cassowary, thank you for your vote. Anyone who comments in lucid words like you are always welcome! We mostly communicate in the mailing list, so why don't you join?
 The above patch is already commited into the trunk, but we're aware of the stuff you've pointed out, and thinking what will be the good choice.
 Anyway, you can use the old style with
(define-special-variable customize-program "sawfish-ui --flatten")
- Teika kazura 01:50, 2 June 2009 (UTC).

Around Wikia's network

Random Wiki