Use different colors for windows and frames in fastswitch-mode. Limit drawing area...
authorPhilippe Brochard <pbrochard@common-lisp.net>
Tue, 30 Jul 2013 17:05:38 +0000 (30 19:05 +0200)
committerPhilippe Brochard <pbrochard@common-lisp.net>
Tue, 30 Jul 2013 17:05:38 +0000 (30 19:05 +0200)
src/clfswm-fastswitch-mode.lisp
src/config.lisp

index 5894798..2acb5a3 100644 (file)
   (labels ((display-match-child ()
              (let ((pos 1))
                (dolist (ex-child *fastswitch-match-child*)
-                 (xlib:with-gcontext (*fastswitch-gc* :foreground (get-color *fastswitch-foreground-letter-second*))
+                 (xlib:with-gcontext (*fastswitch-gc*
+                                      :foreground (get-color (if (frame-p (expose-child-child ex-child))
+                                                                 *fastswitch-foreground-letter-second-frame*
+                                                                 *fastswitch-foreground-letter-second*)))
                    (xlib:draw-glyphs *pixmap-buffer* *fastswitch-gc*
                                      (* (xlib:max-char-width *fastswitch-font*) pos)
                                      (+ (* 2 (xlib:font-ascent *fastswitch-font*)) (xlib:font-descent *fastswitch-font*) 1)
@@ -61,7 +64,9 @@
                                      (* (xlib:max-char-width *fastswitch-font*) pos)
                                      (+ (* 2 (xlib:font-ascent *fastswitch-font*)) (xlib:font-descent *fastswitch-font*) 1)
                                      (child-fullname (expose-child-child ex-child)))
-                   (incf pos (1+ (length (child-fullname (expose-child-child ex-child))))))))))
+                   (incf pos (1+ (length (child-fullname (expose-child-child ex-child))))))
+                 (when (> (* pos (xlib:max-char-width *fastswitch-font*)) (xlib:drawable-width *fastswitch-window*))
+                   (return))))))
     (clear-pixmap-buffer *fastswitch-window* *fastswitch-gc*)
     (xlib:with-gcontext (*fastswitch-gc* :foreground (get-color *fastswitch-foreground-letter*)
                                          :background (get-color *fastswitch-background*))
index 09f4dad..91c5ee7 100644 (file)
@@ -349,6 +349,8 @@ on the root window in the main mode with the mouse")
   'Fastswitch-mode "Fastswitch string window foreground color for letters")
 (defconfig *fastswitch-foreground-letter-second* "magenta"
   'Fastswitch-mode "Fastswitch string window foreground color for letters")
+(defconfig *fastswitch-foreground-letter-second-frame* "yellow"
+  'Fastswitch-mode "Fastswitch string window foreground color for letters for frames")
 (defconfig *fastswitch-foreground-childname* "grey70"
   'Fastswitch-mode "Fastswitch string window foreground color for childname")
 (defconfig *fastswitch-border* "grey20"