Skip to content

Commit

Permalink
configurable float group focus/unfocus colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Giraud authored and dangerousben committed Nov 13, 2011
1 parent 2336dac commit 6086ae4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
7 changes: 3 additions & 4 deletions floating-group.lisp
Expand Up @@ -55,10 +55,9 @@
(defmethod update-decoration ((window float-window))
(let ((group (window-group window)))
(setf (xlib:window-background (window-parent window))
(xlib:alloc-color (xlib:screen-default-colormap (screen-number (window-screen window)))
(if (eq (group-current-window group) window)
"Orange"
"SteelBlue4")))
(if (eq (group-current-window group) window)
(screen-float-focus-color (window-screen window))
(screen-float-unfocus-color (window-screen window))))
(xlib:clear-area (window-parent window))))

(defmethod window-sync ((window float-window) hint)
Expand Down
4 changes: 4 additions & 0 deletions primitives.lisp
Expand Up @@ -357,6 +357,8 @@ are valid values.
(defparameter +default-font-name+ "9x15bold")
(defparameter +default-focus-color+ "White")
(defparameter +default-unfocus-color+ "Black")
(defparameter +default-float-focus-color+ "Orange")
(defparameter +default-float-unfocus-color+ "SteelBlue4")
(defparameter +default-frame-outline-width+ 2)

;; Don't set these variables directly, use set-<var name> instead
Expand Down Expand Up @@ -419,6 +421,8 @@ Use the window's resource name.
(win-bg-color :initform nil :accessor screen-win-bg-color)
(focus-color :initform nil :accessor screen-focus-color)
(unfocus-color :initform nil :accessor screen-unfocus-color)
(float-focus-color :initform nil :accessor screen-float-focus-color)
(float-unfocus-color :initform nil :accessor screen-float-unfocus-color)
(msg-border-width :initform nil :accessor screen-msg-border-width)
(frame-outline-width :initform nil :accessor screen-frame-outline-width)
(font :initform nil :accessor screen-font)
Expand Down
14 changes: 14 additions & 0 deletions screen.lisp
Expand Up @@ -34,6 +34,8 @@
set-win-bg-color
set-focus-color
set-unfocus-color
set-float-focus-color
set-float-unfocus-color
set-msg-border-width
set-frame-outline-width
set-font))
Expand Down Expand Up @@ -287,6 +289,14 @@ there is more than one frame."
there is more than one frame."
(set-any-color screen-unfocus-color color))

(defun set-float-focus-color (color)
"Set the border color for focused windows in a float group."
(set-any-color screen-float-focus-color color))

(defun set-float-unfocus-color (color)
"Set the border color for windows without focus in a float group."
(set-any-color screen-float-unfocus-color color))

(defun set-msg-border-width (width)
"Set the border width for the message bar and input
bar."
Expand Down Expand Up @@ -392,6 +402,8 @@ FOCUS-WINDOW is an extra window used for _NET_SUPPORTING_WM_CHECK."
(border (ac +default-border-color+))
(focus (ac +default-focus-color+))
(unfocus (ac +default-unfocus-color+))
(float-focus (ac +default-float-focus-color+))
(float-unfocus (ac +default-float-unfocus-color+))
(win-bg (ac +default-window-background-color+))
(input-window (xlib:create-window :parent (xlib:screen-root screen-number)
:x 0 :y 0 :width 20 :height 20
Expand Down Expand Up @@ -447,6 +459,8 @@ FOCUS-WINDOW is an extra window used for _NET_SUPPORTING_WM_CHECK."
(screen-border-color screen) border
(screen-focus-color screen) focus
(screen-unfocus-color screen) unfocus
(screen-float-focus-color screen) float-focus
(screen-float-unfocus-color screen) float-unfocus
(screen-msg-border-width screen) 1
(screen-frame-outline-width screen) +default-frame-outline-width+
(screen-input-window screen) input-window
Expand Down
2 changes: 2 additions & 0 deletions stumpwm.texi.in
Expand Up @@ -862,6 +862,8 @@ list. Some commands operate only on marked windows.
@@@ set-win-bg-color
@@@ set-focus-color
@@@ set-unfocus-color
@@@ set-float-focus-color
@@@ set-float-unfocus-color
@@@ set-normal-gravity
@@@ set-maxsize-gravity
@@@ set-transient-gravity
Expand Down

0 comments on commit 6086ae4

Please sign in to comment.