Location: lg@xxxxxxxxxxxxxx http://arch.xwem.org/2005/
Revision: xwem--main--2.1--patch-41
Archive: lg@xxxxxxxxxxxxxx
Creator: Zajcev Evgeny <lg@xxxxxxxx>
Date: Thu Mar 31 03:10:15 MSD 2005
Standard-date: 2005-03-30 23:10:15 GMT
Modified-files: dockapp/xwem-framei.el extra/xwem-keytt.el
extra/xwem-rooticon.el lisp/xwem-clgen.el
lisp/xwem-clients.el lisp/xwem-edmacro.el
lisp/xwem-keyboard.el lisp/xwem-launcher.el
lisp/xwem-misc.el lisp/xwem-netwm.el lisp/xwem-rooter.el
lisp/xwem-special.el utils/xwem-osd.el
New-patches: dev@xxxxxxxxxxxxxxxx/xwem--dev--2.1--patch-30
dev@xxxxxxxxxxxxxxxx/xwem--dev--2.1--patch-31
dev@xxxxxxxxxxxxxxxx/xwem--dev--2.1--patch-32
lg@xxxxxxxxxxxxxx/xwem--main--2.1--patch-41
Summary: Many fixes, minor and major
Keywords: osd, keytt, ranking
* dockapp/xwem-framei.el (xwem-framei-init): xwem-osd-always-ontop removed.
* extra/xwem-keytt.el (xwem-keytt-acroread-keymap): C-v and M-v changed
to <next> and <prior> respectively.
* extra/xwem-rooticon.el (xwem-rooticon-always-on-top-spec): [sem change]
Now list of cons cells in form (MATCH-SPEC . RANK), so root icons for
different clients may have different ranks.
* lisp/xwem-clgen.el (bottom): [bug fix] Set `win-support' property for
generic major mode.
* lisp/xwem-clients.el (xwem-attach-client): [bug fix] clients filtering
fixate.
* lisp/xwem-clients.el (bottom): [bug fix] Set `win-support' property for
dedicated major mode.
* lisp/xwem-edmacro.el (xwem-edmacro-edit-kbd-macro): [fix] Skip default
binding as real key binding.
* lisp/xwem-keyboard.el (xwem-kbd-get-binding): [sem change] Optional
argument REJECT-DEFAULT added. If non-nil do not accept default
binding when looking up key binding.
* lisp/xwem-keyboard.el (xwem-universal-command): [fix] Hack to avoid
double key echoing, when reprocessing command key.
* lisp/xwem-launcher.el (xwem-launcher-parse-arguments): [bug fix]
* lisp/xwem-launcher.el (xwem-launch-generic-program): [bug fix] typo.
* lisp/xwem-misc.el (xwem-xwin-rank): [new] Return x window always on top
rank.
* lisp/xwem-misc.el (xwem-misc-set-xwin-always-on-top): [bug fix] Do
sorting properly.
* lisp/xwem-misc.el (xwem-misc-lower-xwin): [fix] Resort, if necessary
`xwem-misc-always-on-top-stack' when lowering xwin below some sibling.
* lisp/xwem-netwm.el (xwem-fullscreen-iconify-when-inactive): [new]
Non-nil to iconify fullscreen clients that inactivates. NOTE: Non-nil
by default!.
* lisp/xwem-netwm.el (xwem-fullscreen-ai-rank): [new] Ranks pair for
active and inactive states of fullscreen clients.
* lisp/xwem-rooter.el (xwem-rooter-always-on-top-spec): [change] Similiar
to `xwem-rooticon-always-on-top-spec', but for rooter clients.
* utils/xwem-osd.el: Fixes to use OSD's color if color for OSD instance
is ommited.
* added files
{arch}/xwem/xwem--dev/xwem--dev--2.1/dev@xxxxxxxxxxxxxxxx/patch-log/patch-30
{arch}/xwem/xwem--dev/xwem--dev--2.1/dev@xxxxxxxxxxxxxxxx/patch-log/patch-31
{arch}/xwem/xwem--dev/xwem--dev--2.1/dev@xxxxxxxxxxxxxxxx/patch-log/patch-32
{arch}/xwem/xwem--main/xwem--main--2.1/lg@xxxxxxxxxxxxxx/patch-log/patch-41
* modified files
--- orig/dockapp/xwem-framei.el
+++ mod/dockapp/xwem-framei.el
@@ -206,8 +206,7 @@
(unless xdpy
(setq xdpy (xwem-dpy)))
- (let ((xwem-osd-always-ontop nil)
- (rgeom (XGetGeometry xdpy (XDefaultRootWindow xdpy))))
+ (let ((rgeom (XGetGeometry xdpy (XDefaultRootWindow xdpy))))
(setq xwem-framei-osd
(xwem-osd-create xdpy 0 0
(X-Geom-width rgeom)
--- orig/extra/xwem-keytt.el
+++ mod/extra/xwem-keytt.el
@@ -196,8 +196,8 @@
(define-key xwem-keytt-acroread-keymap (kbd "C-x k") (kbd "<self-insert>
C-w")) ; close file
(define-key xwem-keytt-acroread-keymap (kbd "C-n") (kbd "<self-insert>
<down>")) ; scroll down
(define-key xwem-keytt-acroread-keymap (kbd "C-p") (kbd "<self-insert> <up>"))
; scroll up
-(define-key xwem-keytt-acroread-keymap (kbd "C-v") (kbd "<self-insert>
<right>")) ; next page
-(define-key xwem-keytt-acroread-keymap (kbd "M-v") (kbd "<self-insert>
<left>")) ; prev page
+(define-key xwem-keytt-acroread-keymap (kbd "C-v") (kbd "<self-insert>
<next>")) ; next page
+(define-key xwem-keytt-acroread-keymap (kbd "M-v") (kbd "<self-insert>
<prior>")) ; prev page
(define-key xwem-keytt-acroread-keymap (kbd "M->") (kbd "<self-insert>
C-Sh-<next>")) ; last page
(define-key xwem-keytt-acroread-keymap (kbd "M-<") (kbd "<self-insert>
C-Sh-<prior>")) ; first page
(define-key xwem-keytt-acroread-keymap (kbd "C-M-l") (kbd "<self-insert>
C-<left>")) ; first page
--- orig/extra/xwem-rooticon.el
+++ mod/extra/xwem-rooticon.el
@@ -65,8 +65,11 @@
:type 'boolean
:group 'xwem-rooticon)
-(defcustom xwem-rooticon-always-on-top-spec '((eval t))
- "*MATCH-SPEC for always-on-top icons."
+(defcustom xwem-rooticon-always-on-top-spec '((((eval t)) . 30))
+ "*List of cons cells in format:
+\(MATCH-SPEC . RANK) for always-on-top icons.
+If MATCH-SPEC matches rooticon's client - than RANK is set as always
+on top rank."
:type 'sexp
:group 'xwem-rooticon)
@@ -278,8 +281,11 @@
(setq ri (xwem-rooticon-create cl)))
(when ri
;; Set always on top rank (if any)
- (when (xwem-cl-match-p cl xwem-rooticon-always-on-top-spec)
- (xwem-misc-set-xwin-always-on-top (xwem-rooticon-xriwin ri)))
+ (let ((rank (find cl xwem-rooticon-always-on-top-spec
+ :key 'car :test 'xwem-cl-match-p)))
+ (when rank
+ (xwem-misc-set-xwin-always-on-top
+ (xwem-rooticon-xriwin ri) (cdr rank))))
(xwem-rooticon-apply-state ri))))
--- orig/lisp/xwem-clgen.el
+++ mod/lisp/xwem-clgen.el
@@ -429,6 +429,7 @@
:match-spec '(eval t)
:append t
+ :manage-properties '(win-support t)
:manage-method 'xwem-manage-generic
:activate-method 'xwem-activate-generic
:deactivate-method 'xwem-deactivate-generic
--- orig/lisp/xwem-clients.el
+++ mod/lisp/xwem-clients.el
@@ -956,7 +956,8 @@
(and (xwem-manage-property
(xwem-cl-manage-type cl) 'win-support)
(or arg
- (eq (xwem-cl-win cl) (xwem-win-selected))))))
+ (not (xwem-win-selected-p
+ (xwem-cl-win cl)))))))
(cl (xwem-read-client (if arg "XWEM-CL any: " "XWEM-CL: ")
(xwem-cl-list-sort-by-recency
(xwem-clients-list pred)))))
@@ -2399,6 +2400,7 @@
Manage clients in dedicated frame."
:match-spec '(eval nil)
+ :manage-properties '(win-support t)
:manage-method 'xwem-manage-dedicated
:activate-method 'xwem-activate-dedicated
:deactivate-method 'xwem-deactivate-dedicated
--- orig/lisp/xwem-edmacro.el
+++ mod/lisp/xwem-edmacro.el
@@ -114,7 +114,7 @@
(xwem-kbd-stop-grabbing)
- (let ((xwem-cmd (xwem-kbd-get-binding xwem-keys))
+ (let ((xwem-cmd (xwem-kbd-get-binding xwem-keys nil t))
xwem-evs frame)
(setq xwem-evs (cond ((eq xwem-cmd 'xwem-keymacro-play-last)
--- orig/lisp/xwem-keyboard.el
+++ mod/lisp/xwem-keyboard.el
@@ -1166,9 +1166,12 @@
(xwem-global-key-binding client keys accept-default)))))
;;;###xwem-autoload
-(defun xwem-kbd-get-binding (keys &optional client)
- "Get binding value for KEYS."
- (xwem-lookup-key client keys t))
+(defun xwem-kbd-get-binding (keys &optional client reject-default)
+ "Get binding value for KEYS for CLIENT.
+By default CLIENT is currently selected client.
+If optional REJECT-DEFAULT is non-nil, skip looking up default binding
+\(pass `nil' as ACCEPT-DEFAULT to `lookup-key'\)."
+ (xwem-lookup-key client keys (not reject-default)))
(defun xwem-kbd-fixate-current-lkm (lkm)
"In case LKM is not usable, fixate it.
@@ -1633,6 +1636,10 @@
(setq xwem-prefix-arg arg)
(setq xwem-override-map nil)
+ ;; Reprocess last event
+ ;; XXX Avoid double keys echoing
+ (setq xwem-kbd-scheduled-keys
+ (vconcat (butlast (append xwem-kbd-scheduled-keys nil))))
(xwem-dispatch-command-event xwem-last-event xwem-last-xevent))
;;}}}
--- orig/lisp/xwem-launcher.el
+++ mod/lisp/xwem-launcher.el
@@ -212,17 +212,18 @@
(let ((scmd (split-string cmd-str " "))
qarg args cmd)
(while scmd
- (cond ((stringp qarg)
- (setq qarg (concat qarg " " (car scmd)))
- (when (string-match "['\"]$" (car scmd))
- (setq args (cons (if keep-quotes-p
- qarg
- (substring qarg 1 (1- (length qarg))))
- args)
- qarg nil)))
- ((string-match "^['\"]" (car scmd))
- (setq qarg (car scmd)))
- (t (setq args (cons (car scmd) args))))
+ (if (string-match "^['\"]" (car scmd))
+ (setq qarg (car scmd))
+ (when (stringp qarg)
+ (setq qarg (concat qarg " " (car scmd)))))
+ (if (and (stringp qarg)
+ (string-match "['\"]$" (car scmd)))
+ (setq args (cons (if keep-quotes-p
+ qarg
+ (substring qarg 1 (1- (length qarg))))
+ args)
+ qarg nil)
+ (setq args (cons (car scmd) args)))
(setq scmd (cdr scmd)))
;; Pre-normalise command and its arguments
(setq args (remove "" (nreverse args))
@@ -516,7 +517,7 @@
;;;###autoload
(defun xwem-launch-generic-program (cmd sarg)
"Run generic program CMD with arguments SARG."
- (xwem-launch (mapconcat #'identity (cons cmd sarg) " ")))
+ (xwem-launch (mapconcat #'identity (list cmd sarg) " ")))
;; Executing xterm
(defun xwem-xterm-construct-cmd (arg)
--- orig/lisp/xwem-misc.el
+++ mod/lisp/xwem-misc.el
@@ -1598,6 +1598,11 @@
(defvar xwem-misc-always-on-top-stack nil
"List of always-on-top windows.")
+(defmacro xwem-xwin-rank (xwin)
+ `(X-Win-get-prop ,xwin 'always-on-top-rank))
+(defsetf xwem-xwin-rank (xwin) (rank)
+ `(xwem-misc-set-xwin-always-on-top ,xwin ,rank))
+
;;;###xwem-autoload
(defun xwem-misc-set-xwin-always-on-top (xwin &optional rank)
"Mark xwin as always on top window.
@@ -1612,8 +1617,8 @@
(setq xwem-misc-always-on-top-stack
(sort xwem-misc-always-on-top-stack
#'(lambda (xwin1 xwin2)
- (< (X-Win-get-prop xwin1 'always-on-top-rank)
- (X-Win-get-prop xwin1 'always-on-top-rank)))))
+ (< (xwem-xwin-rank xwin1)
+ (xwem-xwin-rank xwin2)))))
;; Finnaly apply RANK to life
(xwem-misc-raise-xwin xwin))
@@ -1635,7 +1640,7 @@
(setq xwem-misc-always-on-top-stack
(delq (car sibs) xwem-misc-always-on-top-stack)
sibs (cdr sibs)))
- (when (funcall operation (X-Win-get-prop (car sibs) 'always-on-top-rank)
rank)
+ (when (funcall operation (xwem-xwin-rank (car sibs)) rank)
(setq rsib (car sibs)
sibs nil))
(setq sibs (cdr sibs)))
@@ -1644,7 +1649,7 @@
;;;###xwem-autoload
(defun xwem-misc-raise-xwin (xwin)
"Raise XWIN reguarding always on top windows."
- (let* ((rank (or (X-Win-get-prop xwin 'always-on-top-rank) 0))
+ (let* ((rank (or (xwem-xwin-rank xwin) 0))
(bsib (and rank (xwem-misc-find-below-sibling '> rank))))
(cond ((not bsib)
(XRaiseWindow (xwem-dpy) xwin))
@@ -1656,11 +1661,16 @@
;;;###xwem-autoload
(defun xwem-misc-lower-xwin (xwin)
"Lower XWIN according to its always on top rank."
- (let* ((rank (X-Win-get-prop xwin 'always-on-top-rank))
+ (let* ((rank (xwem-xwin-rank xwin))
(bsib (and rank (xwem-misc-find-below-sibling '>= rank))))
(cond ((not bsib)
(XLowerWindow (xwem-dpy) xwin))
((not (X-Win-equal xwin bsib))
+ ;; Adjust rank stack in case if ranks are equal
+ (when (= rank (xwem-xwin-rank bsib))
+ (xwem-insert-before
+ (delq xwin xwem-misc-always-on-top-stack)
+ bsib xwin))
(XConfigureWindow (xwem-dpy) xwin
(make-X-Conf :stackmode X-Below
:sibling bsib))))))
--- orig/lisp/xwem-netwm.el
+++ mod/lisp/xwem-netwm.el
@@ -51,6 +51,18 @@
:type 'boolean
:group 'xwem-fullscreen)
+(defcustom xwem-fullscreen-iconify-when-inactive t
+ "*Non-nil mean iconify fullscreen clients, when they gets
inactive/deselected."
+ :type 'boolean
+ :group 'xwem-fullscreen)
+
+(defcustom xwem-fullscreen-ai-rank '(1000 . 0)
+ "*Always on top rank pair for active and inactive states."
+ :type '(cons :tag "Rank pair"
+ (number :tag "Active rank")
+ (number :tag "Inactive rank"))
+ :group 'xwem-fullscreen)
+
;;; Internal variables
;;; Constants
@@ -436,7 +448,7 @@
(xwem-toggle-fullscreen cl))
-;;;###autoload(progn (autoload 'xwem:-fullscreen-manage "xwem-netwm") (put
'managa 'fullscreen 'xwem:-fullscreen-manage))
+;;;###autoload
(defun xwem-manage-fullscreen (cl)
"Manage method for fullscreen client CL."
(XReparentWindow (xwem-dpy) (xwem-cl-xwin cl)
@@ -451,8 +463,9 @@
(xwem-use-local-map xwem-fullscreen-mode-map cl)
(xwem-select-client cl) ; XXX
- (run-hook-with-args 'xwem-fullscreen-mode-hook cl)
- )
+ (run-hook-with-args 'xwem-fullscreen-mode-hook cl))
+
+;;;###autoload(put 'manage 'fullscreen 'xwem-manage-fullscreen)
(defun xwem-fullscreen-refit-full (cl)
"Refit CL to fullscreen."
@@ -500,13 +513,25 @@
(define-xwem-deffered xwem-fullscreen-apply-state (cl)
"Apply CL's state to life."
(when (xwem-cl-p cl)
- (cond ((eq (xwem-cl-state cl) 'active)
- (XMapWindow (xwem-dpy) (xwem-cl-xwin cl))
- (XRaiseWindow (xwem-dpy) (xwem-cl-xwin cl)))
+ (case (xwem-cl-state cl)
+ (active
+ (xwem-misc-set-xwin-always-on-top
+ (xwem-cl-xwin cl) (car xwem-fullscreen-ai-rank))
+ (XMapWindow (xwem-dpy) (xwem-cl-xwin cl)))
- ((memq (xwem-cl-state cl) '(inactive iconified))
- (XLowerWindow (xwem-dpy) (xwem-cl-xwin cl))
- (XUnmapWindow (xwem-dpy) (xwem-cl-xwin cl))))))
+ (inactive
+ (xwem-misc-set-xwin-always-on-top
+ (xwem-cl-xwin cl) (cdr xwem-fullscreen-ai-rank))
+ (when (and xwem-fullscreen-iconify-when-inactive
+ ;; XXX skip dummy clients and special
+ (not (or (xwem-dummy-client-p (xwem-cl-selected))
+ (xwem-special-p (xwem-cl-selected)))))
+ (xwem-iconify cl)))
+
+ (iconified
+ (xwem-misc-set-xwin-always-on-top
+ (xwem-cl-xwin cl) (cdr xwem-fullscreen-ai-rank))
+ (XUnmapWindow (xwem-dpy) (xwem-cl-xwin cl))))))
(defun xwem-activate-fullscreen (cl &optional type)
"Activate method for fullscreen client CL."
@@ -515,6 +540,11 @@
(defun xwem-deactivate-fullscreen (cl &optional type)
"Deactivate fullscreen client CL."
(cond ((eq type 'deactivate)
+ (xwem-fullscreen-apply-state cl))
+
+ ((eq type 'deselect)
+ (when (xwem-cl-active-p cl)
+ (xwem-client-change-state cl 'inactive))
(xwem-fullscreen-apply-state cl))))
(defun xwem-iconify-fullscreen (cl)
--- orig/lisp/xwem-rooter.el
+++ mod/lisp/xwem-rooter.el
@@ -42,8 +42,11 @@
:prefix "xwem-rooter-"
:group 'xwem-modes)
-(defcustom xwem-rooter-always-on-top-spec nil
- "Matchspec for always on top rooters."
+(defcustom xwem-rooter-always-on-top-spec '((((eval t)) . 30))
+ "*List of conscells in form:
+\(MATCH-SPEC . RANK) for always-on-top icons.
+If MATCH-SPEC matches rooticon's client - than RANK is set as always
+on top rank."
:type 'sexp
:group 'xwem-rooter)
@@ -92,9 +95,11 @@
(XReparentWindow xdpy xwin (xwem-rootwin)
(X-Geom-x xgeom) (X-Geom-y xgeom))
- (if (xwem-cl-match-p cl xwem-rooter-always-on-top-spec)
- (xwem-misc-set-xwin-always-on-top xwin)
- (xwem-misc-lower-xwin xwin))
+ ;; Set apropriate always on top rank
+ (let ((rank (find cl xwem-rooter-always-on-top-spec
+ :key 'car :test 'xwem-cl-match-p)))
+ (when rank
+ (xwem-misc-set-xwin-always-on-top xwin (cdr rank))))
(XMapWindow xdpy xwin)
@@ -104,6 +109,8 @@
;; Finnaly run hook
(run-hook-with-args 'xwem-rooter-mode-hook cl)))
+;;;###autoload(put 'manage 'rooter 'xwem-manage-rooter)
+
(defun xwem-activate-rooter (cl &optional type)
"Activate method for rooter clients."
(when (eq type 'select)
--- orig/lisp/xwem-special.el
+++ mod/lisp/xwem-special.el
@@ -198,6 +198,7 @@
(select-frame sfr)
sfr))
+;;;###xwem-autoload
(defun xwem-special-p (cl)
"Return non-nil if CL is special client."
(eq (xwem-cl-manage-type cl) 'emacs-special))
--- orig/utils/xwem-osd.el
+++ mod/utils/xwem-osd.el
@@ -197,17 +197,13 @@
;;; Instances operations
(defun xwem-osd-instance-destroy (osin)
"Destroy osd instance OSIN."
- (XDestroyWindow (xwem-osd-instance-xdpy osin) (xwem-osd-instance-xwin osin))
- (XFreePixmap (xwem-osd-instance-xdpy osin) (xwem-osd-instance-xmask osin))
-
- ;; If OSD instance is 'icon, it is most possible that it has special
- ;; GC in properties, which need to be free'ed.
- (when (eq (xwem-osd-instance-type osin) 'icon)
- (XFreeGC (xwem-osd-instance-xdpy osin)
- (xwem-osd-instance-get-prop osin 'icon-gc)))
+ (let ((xdpy (xwem-osd-instance-xdpy osin)))
+ (XDestroyWindow xdpy (xwem-osd-instance-xwin osin))
+ (XFreeColors xdpy (XDefaultColormap xdpy)
+ (list (xwem-osd-instance-color osin)) nil)
+ (XFreePixmap xdpy (xwem-osd-instance-xmask osin))
- (X-invalidate-cl-struct osin)
- )
+ (X-invalidate-cl-struct osin)))
(defun xwem-osd-add-instance (osd depth &optional color)
"In OSD add osd instance with background COLOR.
@@ -215,18 +211,21 @@
(unless depth
(setq depth 0))
(unless color
- (setq color xwem-osd-default-color))
+ (setq color
+ (or (X-Color-name (X-Gc-foreground (xwem-osd-gc osd)))
+ xwem-osd-default-color)))
- (let ((xdpy (xwem-osd-xdpy osd))
- (osin (make-xwem-osd-instance :osd osd :depth depth
- :color color)))
+ (let* ((xdpy (xwem-osd-xdpy osd))
+ (osin (make-xwem-osd-instance
+ :osd osd :depth depth
+ :color (XAllocNamedColor xdpy (XDefaultColormap xdpy)
+ color))))
(setf (xwem-osd-instance-xwin osin)
(XCreateWindow xdpy (xwem-osd-xwin osd)
0 0 (xwem-osd-width osd) (xwem-osd-height osd)
0 nil nil nil
(make-X-Attr :override-redirect t
- :background-pixel (XAllocNamedColor xdpy
(XDefaultColormap xdpy)
-
color))))
+ :background-pixel
(xwem-osd-instance-color osin))))
(setf (xwem-osd-instance-xmask osin)
(XCreatePixmap xdpy (make-X-Pixmap :dpy xdpy :id (X-Dpy-get-id xdpy))
(xwem-osd-instance-xwin osin) 1
@@ -271,10 +270,13 @@
(defun xwem-osd-instance-set-color (osin new-color)
"Set new color."
(let ((xdpy (xwem-osd-instance-xdpy osin)))
- (setf (xwem-osd-instance-color osin) new-color)
+ (XFreeColors xdpy (XDefaultColormap xdpy)
+ (list (xwem-osd-instance-color osin)) nil)
+ (setf (xwem-osd-instance-color osin)
+ (XAllocNamedColor xdpy (XDefaultColormap xdpy)
+ new-color))
(XSetWindowBackground xdpy (xwem-osd-instance-xwin osin)
- (XAllocNamedColor xdpy (XDefaultColormap xdpy)
- new-color))
+ (xwem-osd-instance-color osin))
(XClearArea xdpy (xwem-osd-instance-xwin osin)
0 0 (xwem-osd-width (xwem-osd-instance-osd osin))
(xwem-osd-height (xwem-osd-instance-osd osin)) nil)))
|