[elpa] externals/xelb 5b969ed: Detect implicit list length
branch: externals/xelb commit 5b969ed9aac902766a3d76f4ed2fd6788d49b86b Author: Chris Feng Commit: Chris Feng Detect implicit list length * el_client.el (xelb-request-fields): New variable holding fields in the current request. (xelb-parse-request): Set/Clear the variable accordingly. (xelb-parse-fieldref): Detect implicit list length. * el_client.el (xelb-parse-request): Remove the extra argument. (xelb-parse-exprfield): Remove the extra quote. --- el_client.el | 26 ++ xcb-types.el |1 - xcb-xim.el| 12 xcb-xproto.el | 12 ++-- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/el_client.el b/el_client.el index 820f7c7..02d78ad 100644 --- a/el_client.el +++ b/el_client.el @@ -60,6 +60,9 @@ (defvar xelb-pad-count -1 " node counter.") (make-variable-buffer-local 'xelb-pad-count) +(defvar xelb-request-fields nil "Fields in the current request.") +(make-variable-buffer-local 'xelb-request-fields) + Helper functions (defsubst xelb-node-name (node) @@ -324,6 +327,13 @@ The `combine-adjacent' attribute is simply ignored." (subnodes (xelb-node-subnodes node t)) expressions result reply-name reply-contents) +;; Fill `xelb-request-fields'. +(setq xelb-request-fields nil) +(dolist (i subnodes) + (unless (eq (xelb-node-name i) 'reply) +(let ((name (xelb-node-attr i 'name))) + (when name +(push (intern (xelb-escape-name name)) xelb-request-fields) (dolist (i subnodes) (if (not (eq (xelb-node-name i) 'reply)) (progn @@ -335,6 +345,7 @@ The `combine-adjacent' attribute is simply ignored." (setq contents (nconc contents result ;; Parse (setq xelb-pad-count -1);reset padding counter +(setq xelb-request-fields nil) ;Clear `xelb-request-fields'. (setq reply-name (intern (concat xelb-prefix (xelb-node-attr node 'name) "~reply"))) @@ -342,14 +353,15 @@ The `combine-adjacent' attribute is simply ignored." (setq reply-contents (apply #'nconc (mapcar #'xelb-parse-structure-content reply-contents) +(setq xelb-request-fields nil) ;Clear `xelb-request-fields'. (delq nil contents) (delq nil `((defclass ,name (xcb:-request) ,contents) ;; The optional expressions ,(when expressions - `(cl-defmethod xcb:marshal ((obj ,name) connection) nil + `(cl-defmethod xcb:marshal ((obj ,name)) nil ,@expressions - (cl-call-next-method obj connection))) + (cl-call-next-method obj))) ;; The optional reply body ,(when reply-name (delq nil reply-contents) @@ -468,7 +480,7 @@ KeymapNotify event; instead, we handle this case in `xcb:unmarshal'." (type (xelb-node-type node)) (value (xelb-parse-expression (xelb-node-subnode node `((,name :type ,type) - (setf (slot-value obj ',name) ',value + (setf (slot-value obj ',name) ,value ;; The only difference between and is whether the `condition' ;; is a list @@ -559,7 +571,13 @@ KeymapNotify event; instead, we handle this case in `xcb:unmarshal'." (defun xelb-parse-fieldref (node) "Parse ." - `(xcb:-fieldref ',(intern (xelb-escape-name (xelb-node-subnode node) + (let ((name (intern (xelb-escape-name (xelb-node-subnode node) +(if (or (not xelb-request-fields) ;Probably not a request. +(memq name xelb-request-fields) +(not (string-suffix-p "-len" (symbol-name name +`(xcb:-fieldref ',name) + `(length +(xcb:-fieldref ',(intern (substring (symbol-name name) 0 -4))) (defun xelb-parse-paramref (node) "Parse ." diff --git a/xcb-types.el b/xcb-types.el index 5bc8908..f4e41f0 100644 --- a/xcb-types.el +++ b/xcb-types.el @@ -41,7 +41,6 @@ ;; + The current implementation of `eieio-default-eval-maybe' only `eval's a ;; certain type of forms. If this is changed in the future, we will have to ;; adapt our codes accordingly. -;; + STRING16 and CHAR2B should always be big-endian. ;; + for `xcb:-marshal-field'? ;; References: diff --git a/xcb-xim.el b/xcb-xim.el index 01229f3..db46f84 100644 --- a/xcb-xim.el +++ b/xcb-xim.el @@ -145,8 +145,7 @@ Consider let-bind it rather than change its global value.")) (defclass xim:STRING (xim:-struct) ((length :initarg :length :type xcb:-u2) (string :initarg :string :type xcb:-ignore) - (string~ :initform '(name string type xim:LPCE - size (xcb:-fieldref 'length)) + (string~ :initform '(name string type xim:LPCE size (xcb:-fieldref 'length)) :type xcb:-list) (pad~0 :initform '(xim:PADDING (+ 2 (
[elpa] externals/exwm 6fe6fe5 1/2: Untabify
branch: externals/exwm commit 6fe6fe52f619bc2e4648cebf137266363f0e19d4 Author: Chris Feng Commit: Chris Feng Untabify --- exwm-floating.el | 132 +++--- exwm-manage.el | 80 exwm.el |6 +- 3 files changed, 109 insertions(+), 109 deletions(-) diff --git a/exwm-floating.el b/exwm-floating.el index cce6de0..a67bc19 100644 --- a/exwm-floating.el +++ b/exwm-floating.el @@ -313,10 +313,10 @@ (let ((buffer-or-id (or (exwm--id->buffer id) id)) frame container-or-id x y width height cursor) (if (bufferp buffer-or-id) - ;; Managed. - (with-current-buffer buffer-or-id - (setq frame exwm--floating-frame - container-or-id exwm--container)) +;; Managed. +(with-current-buffer buffer-or-id + (setq frame exwm--floating-frame +container-or-id exwm--container)) ;; Unmanaged. (setq container-or-id id)) (when (and container-or-id @@ -326,7 +326,7 @@ (xcb:+request-unchecked+reply exwm--connection (make-instance 'xcb:GrabPointer :owner-events 0 - :grab-window container-or-id + :grab-window container-or-id :event-mask xcb:EventMask:NoEvent :pointer-mode xcb:GrabMode:Async :keyboard-mode xcb:GrabMode:Async @@ -337,36 +337,36 @@ (with-slots (root-x root-y win-x win-y) (xcb:+request-unchecked+reply exwm--connection (make-instance 'xcb:QueryPointer :window id)) - (if (not (bufferp buffer-or-id)) - ;; Unmanaged. - (unless (eq type xcb:ewmh:_NET_WM_MOVERESIZE_MOVE) - (with-slots ((width* width) - (height* height)) - (xcb:+request-unchecked+reply exwm--connection - (make-instance 'xcb:GetGeometry :drawable id)) - (setq width width* - height height*))) - ;; Managed. - (select-window (frame-first-window frame)) ;transfer input focus - (setq width (frame-pixel-width frame) - height (frame-pixel-height frame)) - (unless type - ;; Determine the resize type according to the pointer position - ;; Clicking the center 1/3 part to resize has not effect - (setq x (/ (* 3 win-x) (float width)) - y (/ (* 3 win-y) (float height)) - type (cond ((and (< x 1) (< y 1)) - xcb:ewmh:_NET_WM_MOVERESIZE_SIZE_TOPLEFT) -((and (> x 2) (< y 1)) - xcb:ewmh:_NET_WM_MOVERESIZE_SIZE_TOPRIGHT) -((and (> x 2) (> y 2)) - xcb:ewmh:_NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT) -((and (< x 1) (> y 2)) - xcb:ewmh:_NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT) -((> x 2) xcb:ewmh:_NET_WM_MOVERESIZE_SIZE_RIGHT) -((> y 2) xcb:ewmh:_NET_WM_MOVERESIZE_SIZE_BOTTOM) -((< x 1) xcb:ewmh:_NET_WM_MOVERESIZE_SIZE_LEFT) -((< y 1) xcb:ewmh:_NET_WM_MOVERESIZE_SIZE_TOP) +(if (not (bufferp buffer-or-id)) +;; Unmanaged. +(unless (eq type xcb:ewmh:_NET_WM_MOVERESIZE_MOVE) + (with-slots ((width* width) + (height* height)) + (xcb:+request-unchecked+reply exwm--connection + (make-instance 'xcb:GetGeometry :drawable id)) +(setq width width* + height height*))) + ;; Managed. + (select-window (frame-first-window frame)) ;transfer input focus + (setq width (frame-pixel-width frame) +height (frame-pixel-height frame)) + (unless type +;; Determine the resize type according to the pointer position +;; Clicking the center 1/3 part to resize has not effect +(setq x (/ (* 3 win-x) (float width)) + y (/ (* 3 win-y) (float height)) + type (cond ((and (< x 1) (< y 1)) + xcb:ewmh:_NET_WM_MOVERESIZE_SIZE_TOPLEFT) + ((and (> x 2) (< y 1)) + xcb:ewmh:_NET_WM_MOVERESIZE_SIZE_TOPRIGHT) + ((and (> x 2) (> y 2)) + xcb:ewmh:_NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT) + ((and (< x 1) (> y 2)) + xcb:ewmh:_NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT) + ((> x 2) xcb:ewmh:_NET_WM_MOVERESIZE_SIZE_RIGHT) +
[elpa] externals/exwm f0a5425 2/2: Allow floating X windows to resize themselves
branch: externals/exwm commit f0a5425f4c176c487a5c3e94319f0c2b3d3cc22a Author: Chris Feng Commit: Chris Feng Allow floating X windows to resize themselves * exwm-manage.el (exwm-manage--on-ConfigureRequest): Allow (non-fullscreen) floating X windows to resize themselves. --- exwm-manage.el | 37 ++--- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git a/exwm-manage.el b/exwm-manage.el index adc8519..bb6d5ff 100644 --- a/exwm-manage.el +++ b/exwm-manage.el @@ -419,7 +419,9 @@ Would you like to kill it? " border-width: %d; sibling: #x%x; stack-mode: %d" window value-mask width height x y border-width sibling stack-mode) - (if (setq buffer (exwm--id->buffer window)) + (if (and (setq buffer (exwm--id->buffer window)) + (with-current-buffer buffer + (or exwm--fullscreen (not exwm--floating-frame ;; Send client message for managed windows (with-current-buffer buffer (setq edges @@ -444,16 +446,29 @@ border-width: %d; sibling: #x%x; stack-mode: %d" :height (- (elt edges 3) (elt edges 1)) :border-width 0 :override-redirect 0) exwm--connection -(exwm--log "ConfigureWindow (preserve geometry)") -;; Configure the unmanaged window. -(xcb:+request exwm--connection -(make-instance 'xcb:ConfigureWindow - :window window - :value-mask value-mask - :x x :y y :width width :height height - :border-width border-width - :sibling sibling - :stack-mode stack-mode) +(if buffer +(with-current-buffer buffer + (exwm--log "ConfigureWindow (resize floating X window)") + (setq edges +(window-inside-pixel-edges (get-buffer-window buffer t))) + (set-frame-size exwm--floating-frame + (+ width + (- (frame-pixel-width exwm--floating-frame) +(- (elt edges 2) (elt edges 0 + (+ height + (- (frame-pixel-height exwm--floating-frame) +(- (elt edges 3) (elt edges 1 + t)) + (exwm--log "ConfigureWindow (preserve geometry)") + ;; Configure the unmanaged window. + (xcb:+request exwm--connection + (make-instance 'xcb:ConfigureWindow + :window window + :value-mask value-mask + :x x :y y :width width :height height + :border-width border-width + :sibling sibling + :stack-mode stack-mode)) (xcb:flush exwm--connection)) (defun exwm-manage--on-MapRequest (data _synthetic)
[elpa] externals/exwm updated (8706e49 -> f0a5425)
ch11ng pushed a change to branch externals/exwm. from 8706e49 Allow moving/resizing undecorated X windows new 6fe6fe5 Untabify new f0a5425 Allow floating X windows to resize themselves Summary of changes: exwm-floating.el | 132 +++--- exwm-manage.el | 117 +++- exwm.el |6 +- 3 files changed, 135 insertions(+), 120 deletions(-)