mirror of
https://github.com/stumpwm/stumpwm.git
synced 2026-09-10 07:26:20 -04:00
Merge pull request #1245 from BaalHadad/message-windows-class
add window classes for input, message and mode-line windows
This commit is contained in:
commit
a1da956cc3
|
|
@ -23,6 +23,7 @@
|
|||
*mode-line-border-color*
|
||||
*mode-line-border-width*
|
||||
*mode-line-foreground-color*
|
||||
*mode-line-window-class*
|
||||
*mode-line-pad-x*
|
||||
*mode-line-pad-y*
|
||||
*mode-line-position*
|
||||
|
|
@ -48,6 +49,9 @@
|
|||
(defvar *mode-line-pad-y* 1
|
||||
"The number of padding pixels between the modeline text and the top/bottom of the modeline. Integer value.")
|
||||
|
||||
(defvar *mode-line-window-class* "stumpwm-mode-line"
|
||||
"The WM class of a mode-line window.")
|
||||
|
||||
(defvar *mode-line-background-color* "Gray20"
|
||||
"The mode line background color.")
|
||||
|
||||
|
|
@ -206,16 +210,19 @@ timer.")
|
|||
|
||||
(defun make-mode-line-window (screen)
|
||||
"Create a window suitable for a modeline."
|
||||
(xlib:create-window
|
||||
:parent (screen-root screen)
|
||||
:x 0 :y 0 :width 1 :height 1
|
||||
:background (alloc-color screen *mode-line-background-color*)
|
||||
:border (alloc-color screen *mode-line-border-color*)
|
||||
:border-width *mode-line-border-width*
|
||||
;; You can click the modeline
|
||||
:event-mask (xlib:make-event-mask :button-press :exposure)
|
||||
;; these windows are not controlled by the window manager
|
||||
:override-redirect :on))
|
||||
(let ((window
|
||||
(xlib:create-window
|
||||
:parent (screen-root screen)
|
||||
:x 0 :y 0 :width 1 :height 1
|
||||
:background (alloc-color screen *mode-line-background-color*)
|
||||
:border (alloc-color screen *mode-line-border-color*)
|
||||
:border-width *mode-line-border-width*
|
||||
;; You can click the modeline
|
||||
:event-mask (xlib:make-event-mask :button-press :exposure)
|
||||
;; these windows are not controlled by the window manager
|
||||
:override-redirect :on)))
|
||||
(xlib:set-wm-class window *mode-line-window-class* *mode-line-window-class*)
|
||||
window))
|
||||
|
||||
(defun make-mode-line-gc (window screen)
|
||||
(xlib:create-gcontext
|
||||
|
|
|
|||
10
screen.lisp
10
screen.lisp
|
|
@ -25,6 +25,8 @@
|
|||
(in-package #:stumpwm)
|
||||
|
||||
(export '(*default-bg-color*
|
||||
*message-window-class*
|
||||
*input-window-class*
|
||||
current-screen
|
||||
current-window
|
||||
screen-current-window
|
||||
|
|
@ -48,6 +50,12 @@
|
|||
(defvar *default-bg-color* #x333333
|
||||
"Default color for the desktop background.")
|
||||
|
||||
(defvar *message-window-class* "stumpwm-message"
|
||||
"The WM class of a message window.")
|
||||
|
||||
(defvar *input-window-class* "stumpwm-input"
|
||||
"The WM class of an input window.")
|
||||
|
||||
;; Screen helper functions
|
||||
|
||||
(defun translate-id (src src-start src-end font dst dst-start)
|
||||
|
|
@ -482,6 +490,8 @@ FOCUS-WINDOW is an extra window used for _NET_SUPPORTING_WM_CHECK."
|
|||
(tile-group-frame-tree group) (copy-heads screen)
|
||||
(tile-group-current-frame group) (first (tile-group-frame-tree group))
|
||||
(xlib:window-background screen-root) *default-bg-color*)
|
||||
(xlib:set-wm-class message-window *message-window-class* *message-window-class*)
|
||||
(xlib:set-wm-class (screen-input-window screen) *input-window-class* *input-window-class*)
|
||||
;; The focus window is mapped at all times
|
||||
(xlib:map-window (screen-focus-window screen))
|
||||
(xlib:map-window (screen-key-window screen))
|
||||
|
|
|
|||
|
|
@ -1660,6 +1660,7 @@ set these color variables.
|
|||
@@@ set-msg-border-width
|
||||
@@@ set-font
|
||||
|
||||
### *message-window-class*
|
||||
### *message-window-padding*
|
||||
### *message-window-y-padding*
|
||||
### *message-window-margin*
|
||||
|
|
@ -1669,6 +1670,7 @@ set these color variables.
|
|||
### *message-window-timer*
|
||||
### *timeout-wait*
|
||||
### *timeout-wait-multiline*
|
||||
### *input-window-class*
|
||||
### *input-window-gravity*
|
||||
|
||||
@node Using The Input Bar, Programming The Message Bar, Customizing The Bar, Message and Input Bar
|
||||
|
|
@ -2128,6 +2130,7 @@ might do the following:
|
|||
### *time-format-string-default*
|
||||
### *mode-line-fixed-title-width*
|
||||
### *time-modeline-string*
|
||||
### *mode-line-window-class*
|
||||
$$$ *new-mode-line-hook*
|
||||
### *screen-mode-line-formatters*
|
||||
### *window-formatters*
|
||||
|
|
|
|||
Loading…
Reference in a new issue