Re: [Sawfish] Patch to save memory and speed up StyleTab |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/sawfish Archives
]
- To: <sawfish@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [Sawfish] Patch to save memory and speed up StyleTab
- From: fuchur <flohtransporter@xxxxxxxxx>
- Date: Tue, 6 May 2014 18:11:15 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:organization :face:mime-version:content-type; bh=ZC8jTnrieJBGClNuPqBvhImlznAJEREd8KBJarR0bns=; b=ISniXxX4qLX24QZIWP+kfilR1xb8PF9D5x/mrSzC0Vf8PFkAdBhQknEJaSD0xNNq02 1Fjz0635Xw89XHmpRngBa5N6nEovonzyCNKZ8fwsfndCIvNzR4LplM265HdJO+KHPwwU YopHh1Dfvd474lRAYt9+f1L+FRdw7Tk49eyvR1vG5dzHBQ2JJrYtEk6KNlWBa/7jfUD7 E/zSQXtfrOIvQ7eLF35blaq4XWefqFMGGC2vP9/RRfxpJihrQ44G5MouQzdrCF+btrTN pnoFoCHV5iJvq01EpFgjVyDBtnSs5h23GCTIBUlbKy+jf5skZAlv7wO1rnlsQX2g5w1q 95Yg==
- Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEXo6dXi2qlaWEv9/+78//DLrYv889H/lWcuAAACA0lEQVQ4ja2TQW7jMAxF5RbxWmwhrRMB3jtQ6gskBzAVMGupQXT/I8ynZU+n08xuGDhG8vSpL5IycYszPkucLvpt4ik+DQVPkWmvywYv5z8Uz1NNHdFrjCP5bJqHFYxOhMgRUSHawEkVImyJyfhaa59/a0yEwjom/b9Wsl+uAOYvQO+TMRsILL4o8JU6zmS7BYgEYVJFUQPOZ3JzA0nYU1WAVGJ3WNcAfFHfQHXCKbCzK0jhpjv7Whzhh5A7bSD0tfgsDBDCQNwU/BkgKRVcHFYNNKMkAHMXllwAg6hCoDhCbuvLIZuc31SBB0sb8FO8d2TMMQy1SwMnhqsPZPX3uFY/54It35hmIywKRlrANOlJnJAYPApyX02vxZuSWmYxTkGN9xhrVVDSoGutcSg7yMdtcvcMy106ALA1cAF39WU/pUPuUV24JXk1Zsc7djzJDV6LJYdKOfKo7s4fxc3I8WDvyOm5Hb/rlET00KLqpVZWgVbl2iZxJ1vHtSCIYW7ggQ6uAF3ady4JwPmkYPkfhx5SeEd5VvCxgrJsjaNOa6rjBrQXVz0+NTAqKAowBxjcc3Tr/YAtSpgtgNezgh0AXnHU5AFFG7gN7tgUp2hDi+t2TzfQ04N1buLfYCzFE1n5cTnHPldTH9fvQHe3aN8x3X9eZ6eG9/EnWObx28028R/xH8EvDGr5+fmwfm8AAAAASUVORK5CYII=
- Organization: W.W
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
On Sun, 4 May 2014 14:47:45 +0200
wrote fuchur <flohtransporter@xxxxxxxxx>:
>Here i have more for testing. I have completes cabinets gui.
>Patches "10-tab-tiler-add.patch 11-tab-tiler-add.patch" apply after all
>other patches from this thread
Patch 12-tab-tiler-add.patch:
Changes:
Improve move window to next/prev workspace.
Splitline length is now dynamic. (Width from cabinet).
Apply patch after all other patches from this thread.
- --
Regards,
Fuchur
GPG Fingerprint: CA3B 8204 5B3E 6D48 6D53 C116 E5BC 70D5 B8D7 B2B0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iEYEARECAAYFAlNpCaQACgkQ5bxw1bjXsrAr5wCffe5EL1SZjhlzu9vIMRKQDN/C
A68An1P59Kl3/PkfFrZh+MctxM2q0viY
=3GI+
-----END PGP SIGNATURE-----
diff -urNad sawfish.orgi/lisp/sawfish/wm/ext/cabinet.jl sawfish/lisp/sawfish/wm/ext/cabinet.jl
--- sawfish.orgi/lisp/sawfish/wm/ext/cabinet.jl
+++ sawfish/lisp/sawfish/wm/ext/cabinet.jl
@@ -308,7 +308,7 @@
"The text part shown on cabinet item"
;; if we remove a window we temporary need this if
(if (not (numberp (window-id w)))
- "Window is gone"
+ "Window is gone"
(concat (when (window-get w 'marked)
" »»")
(when (window-tabbed-p w)
@@ -360,9 +360,15 @@
(define command-timer nil)
(define bad-key nil)
(define focus-by-tab nil)
+ (define split-line-length nil)
;; item-format package
(define (cabinet-item-text-format w)
+ (let ((split-length (quotient (length (cabinet-item-text w)) 2)))
+ (if (> split-length split-line-length)
+ (if (> split-length 40)
+ (setq split-line-length (- split-length 5))
+ (setq split-line-length split-length))))
(cons (cabinet-item-text w)
(cond
((window-iconified-p w) cabinet:iconified-item-forground)
@@ -410,16 +416,21 @@
0 nil))
nil)
(t (loop (cdr fow-nrl)))))))
-
+
(define (cabinet-split-line)
- (make-item nil
- (format nil "===================%s========================="
- (if workspace-mode
- (format nil " %s/%s "
- current-workspace
- (cdr (workspace-limits)))
- "ALL"))
- cabinet:split-line-forground))
+ (let ((lenght '0)
+ line enil mode)
+ (while (< lenght split-line-length)
+ (setq line (concat line "»"))
+ (setq enil (concat enil "«"))
+ (setq lenght (1+ lenght)))
+ (setq mode (if workspace-mode
+ (format nil "%s/%s"
+ current-workspace
+ (cdr (workspace-limits)))
+ "ALL"))
+ (make-item nil (format nil (concat line mode enil))
+ cabinet:split-line-forground)))
(define (draw-items wl input-line)
(when (x-window-p cabinet-window)
@@ -712,15 +723,23 @@
"Call marked hook if window marked"
(call-window-hook 'window-state-change-hook cmd (list '(marked))))
+ (define (get-last-workspace)
+ (aref (nth 2 (get-x-property 'root '_NET_NUMBER_OF_DESKTOPS)) 0))
+
(defvar move-window-to-next-workspace
(lambda (w)
- (let ((nw (+ (car (window-get w 'workspaces)) 1)))
- (send-to-next-workspace w nw))))
-
+ (unless (window-sticky-p w)
+ (let ((nw (+ (car (window-get w 'workspaces)) 1)))
+ (if (< nw (get-last-workspace))
+ (send-window-to-workspace-from-first w nw))))))
+
(defvar move-window-to-previous-workspace
(lambda (w)
- (let ((nw (- (car (window-get w 'workspaces)) 1)))
- (send-to-next-workspace w nw))))
+ (unless (window-sticky-p w)
+ (let ((nw (- (car (window-get w 'workspaces)) 1)))
+ (if (> nw '-1)
+ (send-window-to-workspace-from-first w nw))))))
+
(defvar move-window-to-top-left
(lambda (w)
@@ -891,6 +910,7 @@
(quotient cabinet:raise-window-timeout 1000) (mod cabinet:raise-window-timeout 1000))))
(when (eq cabinet:manipulation-on-selected 'None)
(set-input-focus nil)))
+ (setq split-line-length nil)
(draw-items (append (mapcar cabinet-item-format wlist-for-manipulation)
(list (cabinet-split-line))
(mapcar cabinet-item-format wlist-for-display))