Location: lg@xxxxxxxxxxxxxx http://arch.xwem.org/2005/
Revision: xwem--main--2.1--patch-22
Archive: lg@xxxxxxxxxxxxxx
Creator: Zajcev Evgeny <lg@xxxxxxxx>
Date: Tue Feb 15 15:45:58 MSK 2005
Standard-date: 2005-02-15 12:45:58 GMT
New-files: xwem-agent/.arch-ids/.arch-inventory.id
xwem-agent/.arch-inventory
Modified-files: Makefile dockapp/xwem-time.el
extra/xwem-ratanot.el lisp/xwem-clgen.el
lisp/xwem-clients.el lisp/xwem-frame.el
lisp/xwem-launcher.el lisp/xwem-main.el
lisp/xwem-report.el lisp/xwem-root.el
lisp/xwem-struct.el lisp/xwem-tabbing.el
lisp/xwem-win.el xwem-agent/xwem-agent.c
New-patches: dev@xxxxxxxxxxxxxxxx/xwem--dev--2.1--patch-15
lg@xxxxxxxxxxxxxx/xwem--main--2.1--patch-22
steve@xxxxxxxxxxxxxx/xwem--steve--2.1--patch-5
Summary: merge from ckent and steve, some fixes, still EXPERIMENTAL.
Keywords: xwem-agent, launcher, window, window-configuration
* Makefile: (DEPS): [addon] Full list of dependences added.
* lisp/xwem-launcher.el (xwem-execute-program-expecting): [new] Execute
program expecting for its management. (EXPERIMENTAL)
* lisp/xwem-launcher.el (many): Use `xwem-execute-program-expecting' when
doing expecting execution.
* lisp/xwem-time.el (xwem-time-default-get-mail): [bug fix] Boolean
return.
* lisp/xwem-clgen.el (xwem-manage-generic): [addon] Find expect-win by
its id.
* lisp/xwem-clients.el (client-window): [change] Now window-id.
* lisp/xwem-main.el (XWEM_RUNNING): [new] (merge from steve)
* lisp/xwem-report.el (xwem-bug-address): [change] xwem-bugs@xxxxxxxx now
* lisp/xwem-struct.el (xwem-win): [addon] id - unique window
identificator added.
* lisp/xwem-struct.el (saved-win): [addon] id - saved unique window
identificator added. !!NOTE!! - This breaks restoring saved(in old
format) frame configuration. You need to resave it in new format! If
using `xwem-desktop-onetime-goals' - just remove files it uses.
* lisp/xwem-win.el (xwem-win-gen-id): [new] Generate unique window
identificator.
* lisp/xwem-win.el (xwem-win-find-by-id): [new] Search for window with
WIN-ID as unique window identificator.
* xwem-agent/xwem-agent.c: Merge from steve, some tiny fixes.
* added files
xwem-agent/.arch-ids/.arch-inventory.id
xwem-agent/.arch-inventory
{arch}/xwem/xwem--dev/xwem--dev--2.1/dev@xxxxxxxxxxxxxxxx/patch-log/patch-15
{arch}/xwem/xwem--main/xwem--main--2.1/lg@xxxxxxxxxxxxxx/patch-log/patch-22
{arch}/xwem/xwem--steve/xwem--steve--2.1/steve@xxxxxxxxxxxxxx/patch-log/patch-5
* modified files
--- orig/Makefile
+++ mod/Makefile
@@ -203,6 +203,7 @@
clean::
rm -f $(AUTO_SOURCES) $(OBJECTS) $(EXTRA_OBJ)
cd man && $(MAKE) clean
+ cd xwem-agent && $(MAKE) clean
distclean: clean
rm -f core* *~ *.TAGS ./lisp/*~ ./dockapp/*~ ./extra/*~ ./utils/*~ \
@@ -219,7 +220,62 @@
#### DEPS
-lisp/xwem-frame.elc: lisp/xwem-struct.elc lisp/xwem-misc.elc
-extra/xwem-smartmods.elc: lisp/xwem-keyboard.elc
+lisp/xwem-load.elc: lisp/xwem-loaddefs.elc lisp/xwem-struct.elc
lisp/xwem-interactive.elc lisp/xwem-faces.elc
+lisp/xwem-win.elc: lisp/xwem-load.elc
+lisp/xwem-frame.elc: lisp/xwem-load.elc lisp/xwem-misc.elc
+lisp/xwem-clgen.elc: lisp/xwem-load.elc lisp/xwem-manage.elc lisp/xwem-misc.elc
+lisp/xwem-clients.elc: lisp/xwem-load.elc lisp/xwem-manage.elc
lisp/xwem-misc.elc
+lisp/xwem-clswi.elc: lisp/xwem-clients.elc
+lisp/xwem-desktop.elc: lisp/xwem-load.elc lisp/xwem-frame.elc
+lisp/xwem-edmacro.elc: lisp/xwem-load.elc
+lisp/xwem-events.elc: lisp/xwem-load.elc
+lisp/xwem-faces.elc: lisp/xwem-struct.elc lisp/xwem-loaddefs.elc
+lisp/xwem-focus.elc: lisp/xwem-load.elc
+lisp/xwem-help.elc: lisp/xwem-load.elc lisp/xwem-misc.elc
+lisp/xwem-icons.elc: lisp/xwem-load.elc
+lisp/xwem-interactive.elc: lisp/xwem-struct.elc lisp/xwem-loaddefs.elc
+lisp/xwem-keyboard.elc: lisp/xwem-load.elc lisp/xwem-misc.elc
+lisp/xwem-keydefs.elc: lisp/xwem-load.elc lisp/xwem-misc.elc
lisp/xwem-compat.elc
+lisp/xwem-keymacro.elc: lisp/xwem-load.elc lisp/xwem-misc.elc
+lisp/xwem-launcher.elc: lisp/xwem-load.elc
+lisp/xwem-main.elc: lisp/xwem-load.elc lisp/xwem-minibuffer.elc
+lisp/xwem-manage.elc: lisp/xwem-load.elc
+lisp/xwem-minibuffer.elc: lisp/xwem-load.elc lisp/xwem-focus.elc
lisp/xwem-manage.elc
+lisp/xwem-misc.elc: lisp/xwem-load.elc
+lisp/xwem-modes.elc: lisp/xwem-load.elc
+lisp/xwem-mouse.elc: lisp/xwem-load.elc lisp/xwem-manage.elc
+lisp/xwem-netwm.elc: lisp/xwem-load.elc lisp/xwem-manage.elc
+lisp/xwem-register.elc: lisp/xwem-load.elc lisp/xwem-help.elc
+lisp/xwem-root.elc: lisp/xwem-load.elc lisp/xwem-misc.elc
+lisp/xwem-rooter.elc: lisp/xwem-load.elc lisp/xwem-manage.elc
lisp/xwem-focus.elc
+lisp/xwem-selections.elc: lisp/xwem-load.elc lisp/xwem-help.elc
+lisp/xwem-sound.elc: lisp/xwem-load.elc
+lisp/xwem-special.elc: lisp/xwem-load.elc lisp/xwem-manage.elc
+lisp/xwem-strokes.elc: lisp/xwem-load.elc lisp/xwem-misc.elc
+lisp/xwem-tabbing.elc: lisp/xwem-load.elc
+lisp/xwem-theme.elc: lisp/xwem-load.elc
+lisp/xwem-transient.elc: lisp/xwem-load.elc lisp/xwem-focus.elc
lisp/xwem-manage.elc
+lisp/xwem-tray.elc: lisp/xwem-load.elc lisp/xwem-help.elc lisp/xwem-manage.elc
+
+utils/xwem-appcollect.elc: lisp/xwem-load.elc lisp/xwem-manage.elc
lisp/xwem-launcher.elc
+utils/xwem-diagram.elc: lisp/xwem-faces.elc
+utils/xwem-holer.elc: lisp/xwem-load.elc lisp/xwem-compat.elc
lisp/xwem-frame.elc
+utils/xwem-osd.elc: utils/xwem-diagram.elc
+utils/xwem-worklog.elc: lisp/xwem-load.elc lisp/xwem-misc.elc
lisp/xwem-compat.elc utils/xwem-diagram.elc
+
+dockapp/xwem-battery.elc: lisp/xwem-load.elc
+dockapp/xwem-framei.elc: lisp/xwem-load.elc lisp/xwem-frame.elc
utils/xwem-osd.elc
+dockapp/xwem-pager.elc: lisp/xwem-load.elc
+dockapp/xwem-time.elc: lisp/xwem-load.elc
+dockapp/xwem-weather.elc: utils/xwem-osd.elc lisp/xwem-interactive.elc
lisp/xwem-help.elc lisp/xwem-compat.elc
+
+extra/xwem-edprops.elc: lisp/xwem-load.elc
+extra/xwem-framtrans.elc: lisp/xwem-load.elc
+extra/xwem-gamma.elc: lisp/xwem-load.elc lisp/xwem-misc.elc
+extra/xwem-ratanot.elc: lisp/xwem-load.elc lisp/xwem-manage.elc
+extra/xwem-recover.elc: lisp/xwem-load.elc
+extra/xwem-rooticon.elc: lisp/xwem-load.elc lisp/xwem-misc.elc
+extra/xwem-smartmods.elc: lisp/xwem-load.elc lisp/xwem-keyboard.elc
+extra/xwem-vert.elc: lisp/xwem-load.elc
.PHONY: clean distclean ./lisp/xwem-version.el
--- orig/dockapp/xwem-time.el
+++ mod/dockapp/xwem-time.el
@@ -955,7 +955,7 @@
(+ (nth 1 now) nowhigh))
;; Record that mail file is accessible.
(setq display-time-server-down-time nil)))))))
- (or (and mail 'letter) 'no-letter)))
+ mail))
(defun xwem-time-get-mail ()
"Return mail status in format acceptable by `xwem-time-update-mail'."
--- orig/extra/xwem-ratanot.el
+++ mod/extra/xwem-ratanot.el
@@ -32,6 +32,8 @@
;;; Code:
+(require 'xwem-load)
+(require 'xwem-manage)
(defvar xwem-rnt-frame-name "xwem-rnt-frame"
"Emacs frame name to be handled by xwem.")
--- orig/lisp/xwem-clgen.el
+++ mod/lisp/xwem-clgen.el
@@ -236,6 +236,9 @@
(let ((dwin (and (xwem-cl-was-expected-p cl)
(xwem-client-property cl 'expect-win))))
+ (when (numberp dwin)
+ (setq dwin (xwem-win-find-by-id dwin)))
+
(if dwin
(xwem-client-set-property cl 'expect-win nil)
(if (xwem-frame-alive-p (xwem-frame-selected))
--- orig/lisp/xwem-clients.el
+++ mod/lisp/xwem-clients.el
@@ -450,9 +450,9 @@
:type 'boolean)
(define-xwem-client-property client-window nil
- "Cons cell in form (FRAME-NUM . WINDOW-NUM) is where client is managed.
-If using windowing managing model."
- :type 'cons)
+ "Window id where client is currently managed.
+Set only if using windowing managing model."
+ :type 'number)
;; X Properties stuff
@@ -472,8 +472,7 @@
"Export CL's plist into XWEM_CLIENT_PLIST X property."
(xwem-cl-XProperty-set
cl "XWEM_CLIENT_PLIST"
- ;; XXX remove 'expect-win
- (plist-put (xwem-client-properties cl) 'expect-win nil)))
+ (xwem-client-properties cl)))
;;; Functions
@@ -1140,6 +1139,8 @@
(XChangeSaveSet (xwem-dpy) (xwem-cl-xwin cl) X-SetModeInsert)
+ (XChangeSaveSet (xwem-dpy) (xwem-cl-xwin cl) X-SetModeInsert)
+
;; Install keyboard grabs, (ARGUSED)
(xwem-kbd-install-grab xwem-global-map xwin)))
@@ -1217,13 +1218,10 @@
(xwem-cl-apply-plist cl (xwem-cl-XProperty-plist cl))
;; Set expectance if 'client-window property is set
- (let* ((fw (xwem-client-property cl 'client-window))
- (frame (and fw (nth (car fw) xwem-frames-list)))
- (win (and (xwem-frame-alive-p frame)
- (xwem-win-find-by-num frame (cdr fw)))))
- (when (xwem-win-alive-p win)
+ (let ((ewin (xwem-client-property cl 'client-window)))
+ (when ewin
(xwem-cl-was-expected cl t)
- (xwem-client-set-property cl 'expect-win win)))
+ (xwem-client-set-property cl 'expect-win ewin)))
(xwem-debug 'xwem-cl "Managing model: %S selected"
'(xwem-cl-manage-type cl))
@@ -1246,6 +1244,10 @@
(unless (xwem-client-property cl 'skip-initial-state)
(xwem-cl-honour-init-state cl))
+ ;; Honour initial client state
+ (unless (xwem-client-property cl 'skip-initial-state)
+ (xwem-cl-honour-init-state cl))
+
;; Run new client hook
(when (xwem-cl-alive-p cl)
(run-hook-with-args 'xwem-cl-create-hook cl))
@@ -1420,29 +1422,24 @@
Prefix ARG specifies how many copies to run."
(xwem-interactive (list (xwem-cl-selected)
(prefix-numeric-value xwem-prefix-arg)))
-
+ (xwem-kbd-stop-grabbing)
(unless (xwem-cl-alive-p cl)
(error 'xwem-error "Invalid client"))
- (let* ((cmd (xwem-hints-wm-command (xwem-cl-hints cl)))
- (mspec (xwem-cl-manage-spec cl))
- (mtype (car mspec))
- (mplist (copy-list (cadr mspec))))
+ (let ((cmd (or (xwem-client-property cl 'executed-command)
+ (xwem-hints-wm-command (xwem-cl-hints cl))))
+ (mspec (xwem-cl-manage-spec cl)))
;; Check command for validity
(when (or (not (stringp cmd)) (string= cmd ""))
(error 'xwem-error "Invalid command: " cmd))
- ;; XXX Adjust plist
- (setq mplist (plist-put mplist 'expect-win (xwem-cl-win cl)))
-
- (setq mspec (list mtype mplist (list 'command cmd)))
- ;; Execute copies using expectances
(while (> arg 0)
-
-q (xwem-manda-add-expectance mspec)
- (xwem-execute-program cmd)
- (setq arg (1- arg)))))
+ (xwem-execute-program-expecting
+ cmd (car mspec) (append (cadr mspec)
+ (when (xwem-cl-win cl)
+ `(expect-win ,(xwem-win-id (xwem-cl-win
cl))))))
+ (decf arg))))
;;;###autoload(autoload 'xwem-client-run-copy-other-win "xwem-clients" "" t)
(define-xwem-command xwem-client-run-copy-other-win (arg &optional cl)
@@ -1470,11 +1467,10 @@
;; Install expectance in hope it will be managed by generic
;; manage type, or some other type that suppors expectances.
- (xwem-manda-add-expectance `(nil (expect-win ,own) (command ,cmd)))
+ (xwem-manda-add-expectance `(nil (expect-win ,(xwem-win-id own))
(command ,cmd)))
;; Finnaly run command
- (xwem-execute-program cmd))
- ))
+ (xwem-execute-program cmd))))
;;;###autoload(autoload 'xwem-client-run-copy-other-frame "xwem-clients" "" t)
(define-xwem-command xwem-client-run-copy-other-frame (arg &optional cl)
@@ -1499,14 +1495,13 @@
;; Setup expectance
(xwem-manda-add-expectance
- `(nil (expect-win ,(xwem-frame-selwin ofr)) (command ,cmd)))
+ `(nil (expect-win ,(xwem-win-id (xwem-frame-selwin ofr))) (command
,cmd)))
;; Finnaly run command
(xwem-execute-program cmd)
;; And select frame
- (xwem-select-frame ofr))
- ))
+ (xwem-select-frame ofr))))
(defun xwem-cl-prog-geom (cl)
"Get program specified geometry for CL."
--- orig/lisp/xwem-frame.el
+++ mod/lisp/xwem-frame.el
@@ -1424,6 +1424,7 @@
(setq xoff (+ xoff nwi)))
(setq n (1- n))))
))
+(put 'xwem-frame-iresize 'xwem-frame-command t)
;;;###autoload(autoload 'xwem-frame-sbs-hor-split "xwem-frame" "" t)
(define-xwem-command xwem-frame-sbs-hor-split (n)
@@ -1669,6 +1670,7 @@
(xwem-window-enlarge-horizontally (- (X-Rect-width xrect)
(xwem-win-width win)) win)))
))))
+(put 'xwem-frame-on-delim-resize 'xwem-frame-command t)
;;;###autoload(autoload 'xwem-frame-on-delim-menu "xwem-frame" "" t)
(define-xwem-command xwem-frame-on-delim-menu ()
--- orig/lisp/xwem-launcher.el
+++ mod/lisp/xwem-launcher.el
@@ -329,11 +329,11 @@
(store-match-data ms))))
;;;###xwem-autoload
-(defun xwem-execute-cmd-expecting (cmd &optional manage-type cl-plist)
+(defun xwem-execute-program-expecting (cmd &optional manage-type cl-plist
non-block)
"Execute CMD expecting till client will be managed.
MANAGE-TYPE specifies which manage type to use in expectance.
CL-PLIST is properties for expected client.
-Return managed client."
+Return managed client unless NON-BLOCK is non-nil."
(setq cmd (xwem-launcher-normalize-cmd cmd))
(let* ((job-num (xwem-next-job-number))
@@ -343,24 +343,26 @@
ccls)
(xwem-manda-add-expectance expt)
(xwem-execute-program cmd)
- (while (memq expt xwem-manage-expectances)
- (dispatch-event (next-event)))
+ (unless non-block
+ (while (memq expt xwem-manage-expectances)
+ (dispatch-event (next-event)))
- ;; Find a client
- (setq ccls xwem-clients)
- (while (and ccls (not (= job-num
- (xwem-client-property (car ccls) 'job-num))))
- (setq ccls (cdr ccls)))
- (when (car ccls)
- (xwem-client-set-property (car ccls) 'executed-command cmd))
- (car ccls)))
+ ;; Find a client
+ (setq ccls xwem-clients)
+ (while (and ccls (not (= job-num
+ (or (xwem-client-property (car ccls) 'job-num)
-1))))
+ (setq ccls (cdr ccls)))
+ (when (car ccls)
+ (xwem-client-set-property (car ccls) 'executed-command cmd))
+ (car ccls))))
-(defun xwem-execute-program-other-win (cmd type)
+(defun xwem-execute-program-other-win (cmd type &optional select-p)
"Execute CMD in other XWEM window, making TYPE split if needed.
-TYPE is one of 'horizontal of 'vertical"
- (setq cmd (xwem-launcher-normalize-cmd cmd))
-
- (let ((own (xwem-window-other 1)))
+TYPE is one of 'horizontal of 'vertical.
+If SELECT-P is non-nil - select newly created client.
+Return newly created client."
+ (let ((own (xwem-window-other 1))
+ cl)
;; Check is there split needed
(when (eq own (xwem-win-selected))
(if (eq type 'horizontal)
@@ -368,54 +370,40 @@
(xwem-window-split-vertically 0))
(setq own (xwem-win-next (xwem-win-selected))))
- (when (xwem-win-p own)
- ;; Install expectation
- (xwem-manda-add-expectance
- `(nil (expect-win ,own job-num ,(xwem-next-job-number))
- (command ,cmd))))
-
- (xwem-execute-program cmd)))
+ (setq cl (xwem-execute-program-expecting
+ cmd nil `(expect-win ,(xwem-win-id own))))
+ (when select-p
+ (xwem-select-client cl))
+ cl))
-(defun xwem-execute-program-other-win-horizontal (cmd)
+(defun xwem-execute-program-other-win-horizontal (cmd &optional select-p)
"Execute CMD in other XWEM window, making horizontal split if needed."
- (xwem-execute-program-other-win cmd 'horizontal))
+ (xwem-execute-program-other-win cmd 'horizontal select-p))
-(defun xwem-execute-program-other-win-vertical (cmd)
+(defun xwem-execute-program-other-win-vertical (cmd &optional select-p)
"Execute CMD in other XWEM window, making vertical split if needed."
- (xwem-execute-program-other-win cmd 'vertical))
-
-(defun xwem-execute-program-other-frame (cmd)
- "Execute CMD in other XWEM frame."
- (setq cmd (xwem-launcher-normalize-cmd cmd))
-
- (let ((oframe (or (xwem-frame-other (xwem-frame-selected))
- (xwem-make-frame-1 'desktop :noselect t))))
+ (xwem-execute-program-other-win cmd 'vertical select-p))
- ;; Install expectance
- (xwem-manda-add-expectance
- `(nil (expect-win ,(xwem-frame-selwin oframe)
- job-num ,(xwem-next-job-number))
- (command ,cmd)))
+(defun xwem-execute-program-other-frame (cmd &optional select-p)
+ "Execute CMD in other XWEM frame.
+If SELECT-P is non-nil select newly managed client."
+ (let* ((oframe (or (xwem-frame-other (xwem-frame-selected))
+ (xwem-make-frame-1 'desktop :noselect t)))
+ (cl (xwem-execute-program-expecting
+ cmd nil `(expect-win ,(xwem-win-id (xwem-frame-selwin
oframe))))))
+ (when select-p
+ (xwem-select-client cl))
+ cl))
- (xwem-execute-program cmd)
- (xwem-select-frame oframe)
- ))
-
-(defun xwem-execute-program-embedded-frame (cmd)
+(defun xwem-execute-program-embedded-frame (cmd &optional select-p)
"Execute CMD in linkaged frame or in embedded XWEM frame."
- (setq cmd (xwem-launcher-normalize-cmd cmd))
-
- (let ((oframe (or (xwem-frame-other (xwem-frame-selected) 'linkage)
- (xwem-make-frame-1 'embedded :noselect t))))
-
- ;; Install expectance
- (xwem-manda-add-expectance
- `(nil (expect-win ,(xwem-frame-selwin oframe) job-num
- ,(xwem-next-job-number))
- (command ,cmd)))
-
- (xwem-execute-program cmd)
- (xwem-select-frame oframe)))
+ (let* ((oframe (or (xwem-frame-other (xwem-frame-selected) 'linkage)
+ (xwem-make-frame-1 'embedded :noselect t)))
+ (cl (xwem-execute-program-expecting
+ cmd nil `(expect-win ,(xwem-win-id (xwem-frame-selwin
oframe))))))
+ (when select-p
+ (xwem-select-client cl))
+ cl))
;;;; XWEM commands.
@@ -483,14 +471,11 @@
application window maps.
If used with numeric prefix ARG, then that number specifies how many
programs to run."
- (xwem-interactive "eLaunch program: \nP")
+ (xwem-interactive "_eLaunch program: \nP")
(cond ((listp arg)
- (xwem-manda-add-expectance
- `(nil (expect-win ,(xwem-win-selected)
- job-num ,(xwem-next-job-number))
- (command ,cmd)))
- (xwem-execute-program cmd))
+ (xwem-execute-program-expecting
+ cmd nil `(expect-win ,(xwem-win-id (xwem-win-selected)))))
((numberp arg)
(while (> arg 0)
@@ -501,43 +486,19 @@
;;;###autoload(autoload 'xwem-launch-program-other-win "xwem-launcher" "" t)
(define-xwem-command xwem-launch-program-other-win (cmd &optional arg)
"Run program in other window.
-If used with prefix ARG, then do horisontal split if needed."
- (xwem-interactive "eLaunch Other Win: \nP")
+If prefix ARG is specified - select newly created client.
+Window spliting (if needed) is controled by `xwem-launcher-split-type'."
+ (xwem-interactive "_eLaunch Other Win: \nP")
- (let ((own (xwem-window-other 1)))
- ;; Check is there split needed
- (when (eq own (xwem-win-selected))
- (if arg
- (xwem-window-split-horizontally 0)
- (xwem-window-split-vertically 0))
- (setq own (xwem-win-next (xwem-win-selected))))
-
- (when (xwem-win-p own)
- ;; Install expectation
- (xwem-manda-add-expectance
- `(nil (expect-win ,own job-num ,(xwem-next-job-number))
- (command ,cmd))))
-
- (xwem-execute-program cmd)))
+ (funcall xwem-launcher-split-type cmd arg))
;;;###autoload(autoload 'xwem-launch-program-other-frame "xwem-launcher" "" t)
(define-xwem-command xwem-launch-program-other-frame (cmd &optional arg)
- "Run programm in other frame."
- (xwem-interactive "eLaunch Other Frame: \nP")
+ "Run programm in other frame.
+If prefix ARG is specified - select newly created client."
+ (xwem-interactive "_eLaunch Other Frame: \nP")
- (let ((oframe (or (xwem-frame-other (xwem-frame-selected))
- (xwem-make-frame-1 (or (and arg 'embedded)
- 'desktop)
- :noselect t))))
-
- ;; Add expectance
- (xwem-manda-add-expectance
- `(nil (expect-win ,(xwem-frame-selwin oframe)
- job-num ,(xwem-next-job-number))
- (command ,cmd)))
-
- (xwem-execute-program cmd)
- (xwem-select-frame oframe)))
+ (funcall xwem-launcher-frame-type cmd arg))
(defsubst xwem-launch (cmd)
"Execute CMD using `xwem-launcher'."
--- orig/lisp/xwem-main.el
+++ mod/lisp/xwem-main.el
@@ -133,7 +133,7 @@
:type 'boolean
:group 'xwem)
-(defcustom xwem-custom-display nil ;"127.0.0.1:2"
+(defcustom xwem-custom-display nil ;"127.0.0.1:2"
"*Custom display, mostly for debugging purposes."
:type '(choice (const :tag "No custom display" nil)
(const "127.0.0.1:2")
@@ -247,6 +247,11 @@
;; Now xwem is fully intialized and it is time to run hooks
(run-hooks 'xwem-after-init-hook)
+ ;; If the user is being tricky with $XWEM_RUNNING variable, set it
+ ;; to "yes"
+ (when (getenv "XWEM_RUNNING")
+ (setenv "XWEM_RUNNING" "yes"))
+
(XSync (xwem-dpy))
(unless xwem-inhibit-startup-message
@@ -272,9 +277,6 @@
(setf allow-deletion-of-last-visible-frame t
auto-lower-frame t
- ;; Printing
- ;print-level 2
-
;; Yes, do it
max-specpdl-size 10000
max-lisp-eval-depth 10000)
@@ -335,6 +337,10 @@
;; Finally run exit hooks
(run-hooks 'xwem-exit-hook)
+ ;; Remove XWEM_RUNNING environment variable if it is set
+ (when (getenv "XWEM_RUNNING")
+ (setenv "XWEM_RUNNING" nil 'unset))
+
;; And close display
(xwem-fini-root)
)
--- orig/lisp/xwem-report.el
+++ mod/lisp/xwem-report.el
@@ -67,7 +67,7 @@
"A list of salutations used for `xwem-report-bug'.")
(defvar xwem-bug-address
- "XWEM Devel <xwem-devel@xxxxxxxx>"
+ "XWEM Bugs <xwem-bugs@xxxxxxxx>"
"The address used for submitting bug reports.")
;;; Functions
--- orig/lisp/xwem-root.el
+++ mod/lisp/xwem-root.el
@@ -128,8 +128,7 @@
(X-Win-EventHandler-add-new (xwem-rootwin) 'xwem-root-events-handler 100)
; (add-hook 'xwem-after-init-hook 'xwem-root-install-grab)
- (add-hook 'xwem-after-init-hook 'xwem-root-install-cursor)
- )
+ (add-hook 'xwem-after-init-hook 'xwem-root-install-cursor))
;;;###autoload
(defun xwem-fini-root ()
--- orig/lisp/xwem-struct.el
+++ mod/lisp/xwem-struct.el
@@ -201,6 +201,7 @@
;;;; Win structures
(defstruct xwem-win
+ id ; unique window id
geom ; window geometry (border width is
internal window width)
clients ; xwem clients list managed in window
cl ; Current window's client
@@ -216,6 +217,7 @@
plist) ; User defined plist
(defstruct (xwem-win-saved (:predicate xwem-iswinsaved-p))
+ id ; saved window id
geom ; saved window geometry
clients ; clients managed in window
cl ; Current window's client
@@ -645,9 +647,7 @@
Do it in safe manner."
`(xwem-unwind-protect
(let ((xwem-override-local-map ,nlm))
- ,@forms)
- nil))
-
+ ,@forms)))
(put 'xwem-overriding-local-map 'lisp-indent-function 'defun)
;;; X Properties
--- orig/lisp/xwem-tabbing.el
+++ mod/lisp/xwem-tabbing.el
@@ -295,6 +295,7 @@
(X-Event-xmotion-root-y xev)))
(:X-ButtonRelease
(xwem-dispatch-command-xevent xev)))))
+(put 'xwem-tabber-smart-drag-frame 'xwem-frame-command t)
;;;###autoload(autoload 'xwem-tabber-popup-cl-menu "xwem-tabber" "" t)
(define-xwem-command xwem-tabber-popup-cl-menu ()
--- orig/lisp/xwem-win.el
+++ mod/lisp/xwem-win.el
@@ -239,6 +239,41 @@
(decf num)))
ch)))
+;; We do want closures in emacs lisp
+(defvar xwem-win-next-id 0)
+(defun xwem-win-gen-id ()
+ "Generate new window id."
+ (truncate (X-Dpy-get-id (xwem-dpy))))
+
+(defun xwem-win-hacked-or (&rest args)
+ "Like `or', but can by used under `apply'."
+ (while (and args (null (car args)))
+ (setq args (cdr args)))
+ (car args))
+
+;;;###xwem-autoload
+(defun xwem-win-find-by-id (win-id &optional win)
+ "Find a window with WIN-ID."
+ (cond ((and (xwem-win-p win)
+ (= (xwem-win-id win) win-id))
+ win)
+
+ ((xwem-win-p win)
+ (or (apply 'xwem-win-hacked-or
+ (mapcar (lambda (w)
+ (xwem-win-find-by-id win-id w))
+ (xwem-win-make-list-by-next (xwem-win-child win))))
+ (apply 'xwem-win-hacked-or
+ (mapcar (lambda (w)
+ (xwem-win-find-by-id win-id w))
+ (delq win (xwem-win-make-list-by-next win))))))
+
+ (t (apply 'xwem-win-hacked-or
+ (mapcar (lambda (w)
+ (xwem-win-find-by-id win-id w))
+ (mapcar 'xwem-frame-rootwin
+ xwem-frames-list))))))
+
;;;###xwem-autoload
(defun xwem-cl-set-win (cl win)
"Associate CL with WIN.
@@ -251,9 +286,8 @@
(setf (xwem-cl-win cl) win)
;; Set also client property
- (xwem-client-set-property cl 'client-window
- (cons (xwem-frame-num (xwem-win-frame win))
- (xwem-win-num win)))
+ (xwem-client-set-property
+ cl 'client-window (and (xwem-win-p win) (xwem-win-id win)))
;; Remove CL from OWIN's clients list
(when (xwem-win-p owin)
@@ -322,7 +356,7 @@
;;;###autoload
(defun xwem-win-new (&optional params props)
"Create new window with properties PROPS."
- (let ((nwin (apply 'make-xwem-win params))
+ (let ((nwin (apply 'make-xwem-win :id (xwem-win-gen-id) params))
(rplist (copy-list xwem-win-default-properties)))
;; Prepare window properties
@@ -1156,6 +1190,7 @@
"Convert an xwem root WIN into a tree of saved-window structures."
(let ((saved-win
(make-xwem-win-saved
+ :id (xwem-win-id win)
:geom (copy-X-Geom (xwem-win-geom win))
:clients (copy-list (xwem-win-clients win))
:cl (xwem-win-cl win)
@@ -1278,8 +1313,9 @@
(defun xwem-win-restore-win-params (config win saved-win)
"Restore the windown parameters stored in SAVED-WIN on WIN."
(let ((cln (xwem-win-saved-cl saved-win)))
- (setf (xwem-win-plist win)
- (copy-list (xwem-win-saved-plist saved-win)))
+ ;; Restore ID and PLIST
+ (setf (xwem-win-id win) (xwem-win-saved-id saved-win)
+ (xwem-win-plist win) (copy-list (xwem-win-saved-plist saved-win)))
;; Resort clients in WIN's order
(xwem-win-reorder-clients saved-win)
--- orig/xwem-agent/xwem-agent.c
+++ mod/xwem-agent/xwem-agent.c
@@ -33,10 +33,13 @@
* So if any problem occurs and somebody(including xwem) causes
* problem to XEmacs and hang it or crash, we lost X session and all
* running clients. It is much of pain. The idea to write xwem-agent
- * firstly occured on #xwem channel by alex-i(Please alex-i name your
- * self, to include your name here) in very interesting discussion
- * about how window manager and desktop environment should be built.
- * Many thanks to alex-i for an excelent idea.
+ * firstly occured on #xwem channel by a discussion between myself and
+ * Steve Youngs about 6 to 12 months ago. The idea was recently
+ * expanded upon an improved after a discussion on IRC with
+ * alex-i(Please alex-i name your self, to include your name here) in
+ * very interesting discussion about how window manager and desktop
+ * environment should be built. Many thanks to alex-i for an excelent
+ * idea.
*
* When xwem-agent starts it install magic keys (C-Sh-F6 and C-Sh-F11)
* by default and starts (S)XEmacs. Whenever you want to restart
@@ -47,6 +50,7 @@
* (S)XEmacs to dump core for futher investigation.
* C-Sh-F11 - Kill (S)XEmacs with SIGTERM signal, this will cause
* (S)XEmacs to terminate normally.
+ * C-Sh-ESC - Exit xwem-agent.
*
** Usage:
*
@@ -137,6 +141,7 @@
XClearWindow(xdpy, RootWindow(xdpy,
DefaultScreen(xdpy)));
y = 13;
}
+ XFlush(xdpy);
}
return ret;
@@ -146,6 +151,8 @@
start_emacs()
{
if ((epid = fork()) == 0) {
+ setenv("XWEM_RUNNING", "notyet", 1);
+
/* Direct (S)XEmacs stdout/stderr to file */
if (outfile) {
int fd = open(outfile, O_CREAT|O_WRONLY|O_APPEND,
@@ -241,7 +248,7 @@
const char *prog = argv[0];
int o_flag = 0;
int ch;
- KeyCode abort_kc, term_kc;
+ KeyCode exit_kc, abort_kc, term_kc;
while ((ch = getopt(argc, argv, "onv:f:")) != -1) {
switch (ch) {
@@ -299,6 +306,10 @@
xverbose(" + InputFocus set to root window ..");
/* Grab magic key */
+ exit_kc = XKeysymToKeycode(xdpy, XK_Escape);
+ XGrabKey(xdpy, exit_kc, ShiftMask|ControlMask,
+ RootWindow(xdpy, DefaultScreen(xdpy)), True,
+ GrabModeAsync, GrabModeAsync);
abort_kc = XKeysymToKeycode(xdpy, XK_F6);
XGrabKey(xdpy, abort_kc, ShiftMask|ControlMask,
RootWindow(xdpy, DefaultScreen(xdpy)), True,
@@ -307,8 +318,10 @@
XGrabKey(xdpy, term_kc, ShiftMask|ControlMask,
RootWindow(xdpy, DefaultScreen(xdpy)), True,
GrabModeAsync, GrabModeAsync);
- xverbose(" + Magic keys at C-Sh-F6(SIGABORT) and C-Sh-F11(SIGTERM)
..");
-
+ xverbose(" + Magic keys at C-Sh-ESC(exit), C-Sh-F6(SIGABORT) and
C-Sh-F11(SIGTERM) ..");
+
+ XFlush(xdpy);
+
if (o_flag == 0)
/* Start (S)XEmacs */
start_emacs();
@@ -322,7 +335,10 @@
case KeyPress:
xverbose("+ Magic KeyPress (S)XEmacs pid=%d ..", epid);
- if (xev.xkey.keycode == abort_kc)
+ if (xev.xkey.keycode == exit_kc) {
+ XCloseDisplay(xdpy);
+ exit(EX_OK);
+ } else if (xev.xkey.keycode == abort_kc)
restart_emacs(SIGABRT);
else if (xev.xkey.keycode == term_kc)
restart_emacs(SIGTERM);
|