mirror of
https://github.com/ch11ng/exwm.git
synced 2024-11-30 14:38:00 +01:00
; Improve debug logs.
This commit is contained in:
parent
fe8274ca7e
commit
58f7916619
8 changed files with 116 additions and 20 deletions
|
@ -83,6 +83,7 @@ This is also used by X window containers.")
|
||||||
|
|
||||||
(defun exwm-floating--set-allowed-actions (id tilling)
|
(defun exwm-floating--set-allowed-actions (id tilling)
|
||||||
"Set _NET_WM_ALLOWED_ACTIONS."
|
"Set _NET_WM_ALLOWED_ACTIONS."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:ewmh:set-_NET_WM_ALLOWED_ACTIONS
|
(make-instance 'xcb:ewmh:set-_NET_WM_ALLOWED_ACTIONS
|
||||||
:window id
|
:window id
|
||||||
|
@ -326,6 +327,7 @@ This is also used by X window containers.")
|
||||||
|
|
||||||
(defun exwm-floating--unset-floating (id)
|
(defun exwm-floating--unset-floating (id)
|
||||||
"Make window ID non-floating."
|
"Make window ID non-floating."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(let ((buffer (exwm--id->buffer id)))
|
(let ((buffer (exwm--id->buffer id)))
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(when exwm--floating-frame
|
(when exwm--floating-frame
|
||||||
|
@ -400,6 +402,7 @@ This is also used by X window containers.")
|
||||||
(cl-defun exwm-floating-toggle-floating ()
|
(cl-defun exwm-floating-toggle-floating ()
|
||||||
"Toggle the current window between floating and non-floating states."
|
"Toggle the current window between floating and non-floating states."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(exwm--log)
|
||||||
(unless (derived-mode-p 'exwm-mode)
|
(unless (derived-mode-p 'exwm-mode)
|
||||||
(cl-return-from exwm-floating-toggle-floating))
|
(cl-return-from exwm-floating-toggle-floating))
|
||||||
(with-current-buffer (window-buffer)
|
(with-current-buffer (window-buffer)
|
||||||
|
@ -411,6 +414,7 @@ This is also used by X window containers.")
|
||||||
(defun exwm-floating-hide ()
|
(defun exwm-floating-hide ()
|
||||||
"Hide the current floating X window (which would show again when selected)."
|
"Hide the current floating X window (which would show again when selected)."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(exwm--log)
|
||||||
(when (and (derived-mode-p 'exwm-mode)
|
(when (and (derived-mode-p 'exwm-mode)
|
||||||
exwm--floating-frame)
|
exwm--floating-frame)
|
||||||
(exwm-layout--hide exwm--id)
|
(exwm-layout--hide exwm--id)
|
||||||
|
@ -418,6 +422,7 @@ This is also used by X window containers.")
|
||||||
|
|
||||||
(defun exwm-floating--start-moveresize (id &optional type)
|
(defun exwm-floating--start-moveresize (id &optional type)
|
||||||
"Start move/resize."
|
"Start move/resize."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(let ((buffer-or-id (or (exwm--id->buffer id) id))
|
(let ((buffer-or-id (or (exwm--id->buffer id) id))
|
||||||
frame container-or-id x y width height cursor)
|
frame container-or-id x y width height cursor)
|
||||||
(if (bufferp buffer-or-id)
|
(if (bufferp buffer-or-id)
|
||||||
|
@ -581,6 +586,7 @@ This is also used by X window containers.")
|
||||||
|
|
||||||
(defun exwm-floating--stop-moveresize (&rest _args)
|
(defun exwm-floating--stop-moveresize (&rest _args)
|
||||||
"Stop move/resize."
|
"Stop move/resize."
|
||||||
|
(exwm--log)
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:UngrabPointer :time xcb:Time:CurrentTime))
|
(make-instance 'xcb:UngrabPointer :time xcb:Time:CurrentTime))
|
||||||
(when exwm-floating--moveresize-calculate
|
(when exwm-floating--moveresize-calculate
|
||||||
|
@ -641,6 +647,7 @@ This is also used by X window containers.")
|
||||||
"Move a floating window right by DELTA-X pixels and down by DELTA-Y pixels.
|
"Move a floating window right by DELTA-X pixels and down by DELTA-Y pixels.
|
||||||
|
|
||||||
Both DELTA-X and DELTA-Y default to 1. This command should be bound locally."
|
Both DELTA-X and DELTA-Y default to 1. This command should be bound locally."
|
||||||
|
(exwm--log "delta-x: %s, delta-y: %s" delta-x delta-y)
|
||||||
(unless (and (derived-mode-p 'exwm-mode) exwm--floating-frame)
|
(unless (and (derived-mode-p 'exwm-mode) exwm--floating-frame)
|
||||||
(user-error "[EXWM] `exwm-floating-move' is only for floating X windows"))
|
(user-error "[EXWM] `exwm-floating-move' is only for floating X windows"))
|
||||||
(unless delta-x (setq delta-x 1))
|
(unless delta-x (setq delta-x 1))
|
||||||
|
@ -663,6 +670,7 @@ Both DELTA-X and DELTA-Y default to 1. This command should be bound locally."
|
||||||
|
|
||||||
(defun exwm-floating--init ()
|
(defun exwm-floating--init ()
|
||||||
"Initialize floating module."
|
"Initialize floating module."
|
||||||
|
(exwm--log)
|
||||||
;; Check border width.
|
;; Check border width.
|
||||||
(unless (and (integerp exwm-floating-border-width)
|
(unless (and (integerp exwm-floating-border-width)
|
||||||
(> exwm-floating-border-width 0))
|
(> exwm-floating-border-width 0))
|
||||||
|
@ -708,7 +716,8 @@ Both DELTA-X and DELTA-Y default to 1. This command should be bound locally."
|
||||||
(xcb:cursor:load-cursor exwm--connection "left_side")))
|
(xcb:cursor:load-cursor exwm--connection "left_side")))
|
||||||
|
|
||||||
(defun exwm-floating--exit ()
|
(defun exwm-floating--exit ()
|
||||||
"Exit the floating module.")
|
"Exit the floating module."
|
||||||
|
(exwm--log))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -221,7 +221,7 @@ ARGS are additional arguments to CALLBACK."
|
||||||
(with-slots (time root event root-x root-y event-x event-y state) evt
|
(with-slots (time root event root-x root-y event-x event-y state) evt
|
||||||
(setq buffer (exwm--id->buffer event)
|
(setq buffer (exwm--id->buffer event)
|
||||||
window (get-buffer-window buffer t))
|
window (get-buffer-window buffer t))
|
||||||
(exwm--log "EnterNotify: buffer=%s; window=%s" buffer window)
|
(exwm--log "buffer=%s; window=%s" buffer window)
|
||||||
(when (and buffer window (not (eq window (selected-window))))
|
(when (and buffer window (not (eq window (selected-window))))
|
||||||
(setq frame (window-frame window)
|
(setq frame (window-frame window)
|
||||||
frame-xid (frame-parameter frame 'exwm-id))
|
frame-xid (frame-parameter frame 'exwm-id))
|
||||||
|
@ -257,6 +257,7 @@ ARGS are additional arguments to CALLBACK."
|
||||||
(xcb:flush exwm--connection)))))
|
(xcb:flush exwm--connection)))))
|
||||||
|
|
||||||
(defun exwm-input--on-keysyms-update ()
|
(defun exwm-input--on-keysyms-update ()
|
||||||
|
(exwm--log)
|
||||||
(let ((exwm-input--global-prefix-keys nil))
|
(let ((exwm-input--global-prefix-keys nil))
|
||||||
(exwm-input--update-global-prefix-keys)))
|
(exwm-input--update-global-prefix-keys)))
|
||||||
|
|
||||||
|
@ -486,6 +487,7 @@ ARGS are additional arguments to CALLBACK."
|
||||||
(xcb:flush exwm--connection)))
|
(xcb:flush exwm--connection)))
|
||||||
|
|
||||||
(defun exwm-input--set-key (key command)
|
(defun exwm-input--set-key (key command)
|
||||||
|
(exwm--log "key: %s, command: %s" key command)
|
||||||
(global-set-key key command)
|
(global-set-key key command)
|
||||||
(cl-pushnew key exwm-input--global-keys))
|
(cl-pushnew key exwm-input--global-keys))
|
||||||
|
|
||||||
|
@ -567,6 +569,7 @@ instead."
|
||||||
|
|
||||||
(defun exwm-input--cache-event (event &optional temp-line-mode)
|
(defun exwm-input--cache-event (event &optional temp-line-mode)
|
||||||
"Cache EVENT."
|
"Cache EVENT."
|
||||||
|
(exwm--log "%s" event)
|
||||||
(setq exwm-input--line-mode-cache
|
(setq exwm-input--line-mode-cache
|
||||||
(vconcat exwm-input--line-mode-cache (vector event)))
|
(vconcat exwm-input--line-mode-cache (vector event)))
|
||||||
;; Attempt to translate this key sequence.
|
;; Attempt to translate this key sequence.
|
||||||
|
@ -673,6 +676,7 @@ The return value is used as event_mode to release the original
|
||||||
button event."
|
button event."
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(let ((read-event (exwm-input--mimic-read-event button-event)))
|
(let ((read-event (exwm-input--mimic-read-event button-event)))
|
||||||
|
(exwm--log "%s" read-event)
|
||||||
(if (and read-event
|
(if (and read-event
|
||||||
(exwm-input--event-passthrough-p read-event))
|
(exwm-input--event-passthrough-p read-event))
|
||||||
;; The event should be forwarded to emacs
|
;; The event should be forwarded to emacs
|
||||||
|
@ -687,10 +691,12 @@ button event."
|
||||||
"Handle button events in char-mode.
|
"Handle button events in char-mode.
|
||||||
The return value is used as event_mode to release the original
|
The return value is used as event_mode to release the original
|
||||||
button event."
|
button event."
|
||||||
|
(exwm--log)
|
||||||
xcb:Allow:ReplayPointer)
|
xcb:Allow:ReplayPointer)
|
||||||
|
|
||||||
(defun exwm-input--update-mode-line (id)
|
(defun exwm-input--update-mode-line (id)
|
||||||
"Update the propertized `mode-line-process' for window ID."
|
"Update the propertized `mode-line-process' for window ID."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(let (help-echo cmd mode)
|
(let (help-echo cmd mode)
|
||||||
(cl-case exwm--input-mode
|
(cl-case exwm--input-mode
|
||||||
(line-mode
|
(line-mode
|
||||||
|
@ -822,6 +828,7 @@ button event."
|
||||||
EXWM will prompt for the key to send. This command can be prefixed to send
|
EXWM will prompt for the key to send. This command can be prefixed to send
|
||||||
multiple keys."
|
multiple keys."
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
|
(exwm--log)
|
||||||
(unless (derived-mode-p 'exwm-mode)
|
(unless (derived-mode-p 'exwm-mode)
|
||||||
(cl-return-from exwm-input-send-next-key))
|
(cl-return-from exwm-input-send-next-key))
|
||||||
(when (> times 12) (setq times 12))
|
(when (> times 12) (setq times 12))
|
||||||
|
@ -840,6 +847,7 @@ multiple keys."
|
||||||
|
|
||||||
(defun exwm-input--set-simulation-keys (simulation-keys &optional no-refresh)
|
(defun exwm-input--set-simulation-keys (simulation-keys &optional no-refresh)
|
||||||
"Set simulation keys."
|
"Set simulation keys."
|
||||||
|
(exwm--log "%s" simulation-keys)
|
||||||
(unless no-refresh
|
(unless no-refresh
|
||||||
;; Unbind simulation keys.
|
;; Unbind simulation keys.
|
||||||
(let ((hash (buffer-local-value 'exwm-input--simulation-keys
|
(let ((hash (buffer-local-value 'exwm-input--simulation-keys
|
||||||
|
@ -941,6 +949,7 @@ ends unless it's specifically saved in the Customize interface for
|
||||||
(format "Simulate %s as" (key-description original))
|
(format "Simulate %s as" (key-description original))
|
||||||
?\C-g)))
|
?\C-g)))
|
||||||
(list original simulated)))
|
(list original simulated)))
|
||||||
|
(exwm--log "original: %s, simulated: %s" original-key simulated-key)
|
||||||
(when (and original-key simulated-key)
|
(when (and original-key simulated-key)
|
||||||
(let ((entry `((,original-key . ,simulated-key))))
|
(let ((entry `((,original-key . ,simulated-key))))
|
||||||
(setq exwm-input-simulation-keys (append exwm-input-simulation-keys
|
(setq exwm-input-simulation-keys (append exwm-input-simulation-keys
|
||||||
|
@ -949,6 +958,7 @@ ends unless it's specifically saved in the Customize interface for
|
||||||
|
|
||||||
(defun exwm-input--unset-simulation-keys ()
|
(defun exwm-input--unset-simulation-keys ()
|
||||||
"Clear simulation keys and key bindings defined."
|
"Clear simulation keys and key bindings defined."
|
||||||
|
(exwm--log)
|
||||||
(when (hash-table-p exwm-input--simulation-keys)
|
(when (hash-table-p exwm-input--simulation-keys)
|
||||||
(maphash (lambda (key _value)
|
(maphash (lambda (key _value)
|
||||||
(when (sequencep key)
|
(when (sequencep key)
|
||||||
|
@ -961,6 +971,7 @@ ends unless it's specifically saved in the Customize interface for
|
||||||
|
|
||||||
SIMULATION-KEYS is an alist of the form (original-key . simulated-key),
|
SIMULATION-KEYS is an alist of the form (original-key . simulated-key),
|
||||||
where both ORIGINAL-KEY and SIMULATED-KEY are key sequences."
|
where both ORIGINAL-KEY and SIMULATED-KEY are key sequences."
|
||||||
|
(exwm--log)
|
||||||
(make-local-variable 'exwm-input--simulation-keys)
|
(make-local-variable 'exwm-input--simulation-keys)
|
||||||
(use-local-map (copy-keymap exwm-mode-map))
|
(use-local-map (copy-keymap exwm-mode-map))
|
||||||
(let ((exwm-input--local-simulation-keys t))
|
(let ((exwm-input--local-simulation-keys t))
|
||||||
|
@ -970,6 +981,7 @@ where both ORIGINAL-KEY and SIMULATED-KEY are key sequences."
|
||||||
(cl-defun exwm-input-send-simulation-key (times)
|
(cl-defun exwm-input-send-simulation-key (times)
|
||||||
"Fake a key event according to the last input key sequence."
|
"Fake a key event according to the last input key sequence."
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
|
(exwm--log)
|
||||||
(unless (derived-mode-p 'exwm-mode)
|
(unless (derived-mode-p 'exwm-mode)
|
||||||
(cl-return-from exwm-input-send-simulation-key))
|
(cl-return-from exwm-input-send-simulation-key))
|
||||||
(let ((keys (gethash (this-single-command-keys)
|
(let ((keys (gethash (this-single-command-keys)
|
||||||
|
@ -989,6 +1001,7 @@ where both ORIGINAL-KEY and SIMULATED-KEY are key sequences."
|
||||||
|
|
||||||
(defun exwm-input--init ()
|
(defun exwm-input--init ()
|
||||||
"Initialize the keyboard module."
|
"Initialize the keyboard module."
|
||||||
|
(exwm--log)
|
||||||
;; Refresh keyboard mapping
|
;; Refresh keyboard mapping
|
||||||
(xcb:keysyms:init exwm--connection #'exwm-input--on-keysyms-update)
|
(xcb:keysyms:init exwm--connection #'exwm-input--on-keysyms-update)
|
||||||
;; Create the X window and intern the atom used to fetch timestamp.
|
;; Create the X window and intern the atom used to fetch timestamp.
|
||||||
|
@ -1046,10 +1059,12 @@ where both ORIGINAL-KEY and SIMULATED-KEY are key sequences."
|
||||||
|
|
||||||
(defun exwm-input--post-init ()
|
(defun exwm-input--post-init ()
|
||||||
"The second stage in the initialization of the input module."
|
"The second stage in the initialization of the input module."
|
||||||
|
(exwm--log)
|
||||||
(exwm-input--update-global-prefix-keys))
|
(exwm-input--update-global-prefix-keys))
|
||||||
|
|
||||||
(defun exwm-input--exit ()
|
(defun exwm-input--exit ()
|
||||||
"Exit the input module."
|
"Exit the input module."
|
||||||
|
(exwm--log)
|
||||||
(exwm-input--unset-simulation-keys)
|
(exwm-input--unset-simulation-keys)
|
||||||
(remove-hook 'pre-command-hook #'exwm-input--on-pre-command)
|
(remove-hook 'pre-command-hook #'exwm-input--on-pre-command)
|
||||||
(remove-hook 'post-command-hook #'exwm-input--on-post-command)
|
(remove-hook 'post-command-hook #'exwm-input--on-post-command)
|
||||||
|
|
|
@ -479,6 +479,7 @@ windows."
|
||||||
|
|
||||||
See also `exwm-layout-enlarge-window'."
|
See also `exwm-layout-enlarge-window'."
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
|
(exwm--log "%s" delta)
|
||||||
(exwm-layout-enlarge-window delta t))
|
(exwm-layout-enlarge-window delta t))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
@ -487,6 +488,7 @@ See also `exwm-layout-enlarge-window'."
|
||||||
|
|
||||||
See also `exwm-layout-enlarge-window'."
|
See also `exwm-layout-enlarge-window'."
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
|
(exwm--log "%s" delta)
|
||||||
(exwm-layout-enlarge-window (- delta)))
|
(exwm-layout-enlarge-window (- delta)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
@ -495,6 +497,7 @@ See also `exwm-layout-enlarge-window'."
|
||||||
|
|
||||||
See also `exwm-layout-enlarge-window'."
|
See also `exwm-layout-enlarge-window'."
|
||||||
(interactive "p")
|
(interactive "p")
|
||||||
|
(exwm--log "%s" delta)
|
||||||
(exwm-layout-enlarge-window (- delta) t))
|
(exwm-layout-enlarge-window (- delta) t))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
|
|
@ -565,7 +565,7 @@ Would you like to kill it? "
|
||||||
(with-slots (window x y width height
|
(with-slots (window x y width height
|
||||||
border-width sibling stack-mode value-mask)
|
border-width sibling stack-mode value-mask)
|
||||||
obj
|
obj
|
||||||
(exwm--log "ConfigureRequest from #x%x (#x%x) @%dx%d%+d%+d; \
|
(exwm--log "#x%x (#x%x) @%dx%d%+d%+d; \
|
||||||
border-width: %d; sibling: #x%x; stack-mode: %d"
|
border-width: %d; sibling: #x%x; stack-mode: %d"
|
||||||
window value-mask width height x y
|
window value-mask width height x y
|
||||||
border-width sibling stack-mode)
|
border-width sibling stack-mode)
|
||||||
|
@ -663,7 +663,7 @@ border-width: %d; sibling: #x%x; stack-mode: %d"
|
||||||
(progn (xcb:+request exwm--connection
|
(progn (xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:MapWindow :window window))
|
(make-instance 'xcb:MapWindow :window window))
|
||||||
(xcb:flush exwm--connection))
|
(xcb:flush exwm--connection))
|
||||||
(exwm--log "MapRequest from #x%x" window)
|
(exwm--log "#x%x" window)
|
||||||
(exwm-manage--manage-window window))))))
|
(exwm-manage--manage-window window))))))
|
||||||
|
|
||||||
(defun exwm-manage--on-UnmapNotify (data _synthetic)
|
(defun exwm-manage--on-UnmapNotify (data _synthetic)
|
||||||
|
@ -705,7 +705,7 @@ border-width: %d; sibling: #x%x; stack-mode: %d"
|
||||||
(exwm--log)
|
(exwm--log)
|
||||||
(let ((obj (make-instance 'xcb:DestroyNotify)))
|
(let ((obj (make-instance 'xcb:DestroyNotify)))
|
||||||
(xcb:unmarshal obj data)
|
(xcb:unmarshal obj data)
|
||||||
(exwm--log "DestroyNotify from #x%x" (slot-value obj 'window))
|
(exwm--log "#x%x" (slot-value obj 'window))
|
||||||
(exwm-manage--unmanage-window (slot-value obj 'window)))))
|
(exwm-manage--unmanage-window (slot-value obj 'window)))))
|
||||||
|
|
||||||
(defun exwm-manage--init ()
|
(defun exwm-manage--init ()
|
||||||
|
@ -732,6 +732,7 @@ border-width: %d; sibling: #x%x; stack-mode: %d"
|
||||||
|
|
||||||
(defun exwm-manage--exit ()
|
(defun exwm-manage--exit ()
|
||||||
"Exit the manage module."
|
"Exit the manage module."
|
||||||
|
(exwm--log)
|
||||||
(dolist (pair exwm--id-buffer-alist)
|
(dolist (pair exwm--id-buffer-alist)
|
||||||
(exwm-manage--unmanage-window (car pair) 'quit))
|
(exwm-manage--unmanage-window (car pair) 'quit))
|
||||||
(remove-hook 'after-make-frame-functions #'exwm-manage--add-frame)
|
(remove-hook 'after-make-frame-functions #'exwm-manage--add-frame)
|
||||||
|
|
|
@ -123,12 +123,12 @@ corresponding monitors whenever the monitors are active.
|
||||||
:width width
|
:width width
|
||||||
:height height)
|
:height height)
|
||||||
monitor-plist (plist-put monitor-plist monitor-name geometry))
|
monitor-plist (plist-put monitor-plist monitor-name geometry))
|
||||||
|
(exwm--log "%s: %sx%s+%s+%s" monitor-name x y width height)
|
||||||
;; Save primary monitor when available (fallback to the first one).
|
;; Save primary monitor when available (fallback to the first one).
|
||||||
(when (or (/= 0 primary)
|
(when (or (/= 0 primary)
|
||||||
(not primary-monitor))
|
(not primary-monitor))
|
||||||
(setq primary-monitor monitor-name)))))
|
(setq primary-monitor monitor-name)))))
|
||||||
(exwm--log "Primary monitor: %s" primary-monitor)
|
(exwm--log "Primary monitor: %s" primary-monitor)
|
||||||
(exwm--log "Monitors: %s" monitor-plist)
|
|
||||||
(list primary-monitor monitor-plist)))
|
(list primary-monitor monitor-plist)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
|
@ -233,6 +233,7 @@ Refresh when any RandR 1.5 monitor changes."
|
||||||
|
|
||||||
(defun exwm-randr--init ()
|
(defun exwm-randr--init ()
|
||||||
"Initialize RandR extension and EXWM RandR module."
|
"Initialize RandR extension and EXWM RandR module."
|
||||||
|
(exwm--log)
|
||||||
(if (= 0 (slot-value (xcb:get-extension-data exwm--connection 'xcb:randr)
|
(if (= 0 (slot-value (xcb:get-extension-data exwm--connection 'xcb:randr)
|
||||||
'present))
|
'present))
|
||||||
(error "[EXWM] RandR extension is not supported by the server")
|
(error "[EXWM] RandR extension is not supported by the server")
|
||||||
|
@ -270,10 +271,12 @@ Refresh when any RandR 1.5 monitor changes."
|
||||||
|
|
||||||
(defun exwm-randr--exit ()
|
(defun exwm-randr--exit ()
|
||||||
"Exit the RandR module."
|
"Exit the RandR module."
|
||||||
|
(exwm--log)
|
||||||
(remove-hook 'exwm-workspace-list-change-hook #'exwm-randr-refresh))
|
(remove-hook 'exwm-workspace-list-change-hook #'exwm-randr-refresh))
|
||||||
|
|
||||||
(defun exwm-randr-enable ()
|
(defun exwm-randr-enable ()
|
||||||
"Enable RandR support for EXWM."
|
"Enable RandR support for EXWM."
|
||||||
|
(exwm--log)
|
||||||
(add-hook 'exwm-init-hook #'exwm-randr--init)
|
(add-hook 'exwm-init-hook #'exwm-randr--init)
|
||||||
(add-hook 'exwm-exit-hook #'exwm-randr--exit))
|
(add-hook 'exwm-exit-hook #'exwm-randr--exit))
|
||||||
|
|
||||||
|
|
|
@ -86,13 +86,13 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
|
|
||||||
(defun exwm-systemtray--embed (icon)
|
(defun exwm-systemtray--embed (icon)
|
||||||
"Embed an icon."
|
"Embed an icon."
|
||||||
(exwm--log "(System Tray) Try to embed #x%x" icon)
|
(exwm--log "Try to embed #x%x" icon)
|
||||||
(let ((info (xcb:+request-unchecked+reply exwm-systemtray--connection
|
(let ((info (xcb:+request-unchecked+reply exwm-systemtray--connection
|
||||||
(make-instance 'xcb:xembed:get-_XEMBED_INFO
|
(make-instance 'xcb:xembed:get-_XEMBED_INFO
|
||||||
:window icon)))
|
:window icon)))
|
||||||
width* height* visible)
|
width* height* visible)
|
||||||
(when info
|
(when info
|
||||||
(exwm--log "(System Tray) Embed #x%x" icon)
|
(exwm--log "Embed #x%x" icon)
|
||||||
(with-slots (width height)
|
(with-slots (width height)
|
||||||
(xcb:+request-unchecked+reply exwm-systemtray--connection
|
(xcb:+request-unchecked+reply exwm-systemtray--connection
|
||||||
(make-instance 'xcb:GetGeometry :drawable icon))
|
(make-instance 'xcb:GetGeometry :drawable icon))
|
||||||
|
@ -101,7 +101,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
(when (< width* exwm-systemtray--icon-min-size)
|
(when (< width* exwm-systemtray--icon-min-size)
|
||||||
(setq width* exwm-systemtray--icon-min-size
|
(setq width* exwm-systemtray--icon-min-size
|
||||||
height* (round (* height (/ (float width*) width)))))
|
height* (round (* height (/ (float width*) width)))))
|
||||||
(exwm--log "(System Tray) Resize from %dx%d to %dx%d"
|
(exwm--log "Resize from %dx%d to %dx%d"
|
||||||
width height width* height*))
|
width height width* height*))
|
||||||
;; Add this icon to save-set.
|
;; Add this icon to save-set.
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
|
@ -151,7 +151,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
;; Default to visible.
|
;; Default to visible.
|
||||||
(setq visible t))
|
(setq visible t))
|
||||||
(when visible
|
(when visible
|
||||||
(exwm--log "(System Tray) Map the window")
|
(exwm--log "Map the window")
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:MapWindow :window icon)))
|
(make-instance 'xcb:MapWindow :window icon)))
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
|
@ -175,7 +175,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
|
|
||||||
(defun exwm-systemtray--unembed (icon)
|
(defun exwm-systemtray--unembed (icon)
|
||||||
"Unembed an icon."
|
"Unembed an icon."
|
||||||
(exwm--log "(System Tray) Unembed #x%x" icon)
|
(exwm--log "Unembed #x%x" icon)
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:UnmapWindow :window icon))
|
(make-instance 'xcb:UnmapWindow :window icon))
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
|
@ -189,6 +189,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
|
|
||||||
(defun exwm-systemtray--refresh ()
|
(defun exwm-systemtray--refresh ()
|
||||||
"Refresh the system tray."
|
"Refresh the system tray."
|
||||||
|
(exwm--log)
|
||||||
;; Make sure to redraw the embedder.
|
;; Make sure to redraw the embedder.
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:UnmapWindow
|
(make-instance 'xcb:UnmapWindow
|
||||||
|
@ -222,6 +223,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
|
|
||||||
(defun exwm-systemtray--on-DestroyNotify (data _synthetic)
|
(defun exwm-systemtray--on-DestroyNotify (data _synthetic)
|
||||||
"Unembed icons on DestroyNotify."
|
"Unembed icons on DestroyNotify."
|
||||||
|
(exwm--log)
|
||||||
(let ((obj (make-instance 'xcb:DestroyNotify)))
|
(let ((obj (make-instance 'xcb:DestroyNotify)))
|
||||||
(xcb:unmarshal obj data)
|
(xcb:unmarshal obj data)
|
||||||
(with-slots (window) obj
|
(with-slots (window) obj
|
||||||
|
@ -230,6 +232,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
|
|
||||||
(defun exwm-systemtray--on-ReparentNotify (data _synthetic)
|
(defun exwm-systemtray--on-ReparentNotify (data _synthetic)
|
||||||
"Unembed icons on ReparentNotify."
|
"Unembed icons on ReparentNotify."
|
||||||
|
(exwm--log)
|
||||||
(let ((obj (make-instance 'xcb:ReparentNotify)))
|
(let ((obj (make-instance 'xcb:ReparentNotify)))
|
||||||
(xcb:unmarshal obj data)
|
(xcb:unmarshal obj data)
|
||||||
(with-slots (window parent) obj
|
(with-slots (window parent) obj
|
||||||
|
@ -239,6 +242,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
|
|
||||||
(defun exwm-systemtray--on-ResizeRequest (data _synthetic)
|
(defun exwm-systemtray--on-ResizeRequest (data _synthetic)
|
||||||
"Resize the tray icon on ResizeRequest."
|
"Resize the tray icon on ResizeRequest."
|
||||||
|
(exwm--log)
|
||||||
(let ((obj (make-instance 'xcb:ResizeRequest))
|
(let ((obj (make-instance 'xcb:ResizeRequest))
|
||||||
attr)
|
attr)
|
||||||
(xcb:unmarshal obj data)
|
(xcb:unmarshal obj data)
|
||||||
|
@ -266,6 +270,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
|
|
||||||
(defun exwm-systemtray--on-PropertyNotify (data _synthetic)
|
(defun exwm-systemtray--on-PropertyNotify (data _synthetic)
|
||||||
"Map/Unmap the tray icon on PropertyNotify."
|
"Map/Unmap the tray icon on PropertyNotify."
|
||||||
|
(exwm--log)
|
||||||
(let ((obj (make-instance 'xcb:PropertyNotify))
|
(let ((obj (make-instance 'xcb:PropertyNotify))
|
||||||
attr info visible)
|
attr info visible)
|
||||||
(xcb:unmarshal obj data)
|
(xcb:unmarshal obj data)
|
||||||
|
@ -279,7 +284,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
(when info
|
(when info
|
||||||
(setq visible (/= 0 (logand (slot-value info 'flags)
|
(setq visible (/= 0 (logand (slot-value info 'flags)
|
||||||
xcb:xembed:MAPPED)))
|
xcb:xembed:MAPPED)))
|
||||||
(exwm--log "(System Tray) #x%x visible? %s" window visible)
|
(exwm--log "#x%x visible? %s" window visible)
|
||||||
(if visible
|
(if visible
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:MapWindow :window window))
|
(make-instance 'xcb:MapWindow :window window))
|
||||||
|
@ -297,6 +302,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
(when (eq type xcb:Atom:_NET_SYSTEM_TRAY_OPCODE)
|
(when (eq type xcb:Atom:_NET_SYSTEM_TRAY_OPCODE)
|
||||||
(setq data32 (slot-value data 'data32)
|
(setq data32 (slot-value data 'data32)
|
||||||
opcode (elt data32 1))
|
opcode (elt data32 1))
|
||||||
|
(exwm--log "opcode: %s" opcode)
|
||||||
(cond ((= opcode xcb:systemtray:opcode:REQUEST-DOCK)
|
(cond ((= opcode xcb:systemtray:opcode:REQUEST-DOCK)
|
||||||
(unless (assoc (elt data32 2) exwm-systemtray--list)
|
(unless (assoc (elt data32 2) exwm-systemtray--list)
|
||||||
(exwm-systemtray--embed (elt data32 2))))
|
(exwm-systemtray--embed (elt data32 2))))
|
||||||
|
@ -304,10 +310,11 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
((or (= opcode xcb:systemtray:opcode:BEGIN-MESSAGE)
|
((or (= opcode xcb:systemtray:opcode:BEGIN-MESSAGE)
|
||||||
(= opcode xcb:systemtray:opcode:CANCEL-MESSAGE)))
|
(= opcode xcb:systemtray:opcode:CANCEL-MESSAGE)))
|
||||||
(t
|
(t
|
||||||
(exwm--log "(System Tray) Unknown opcode message: %s" obj)))))))
|
(exwm--log "Unknown opcode message: %s" obj)))))))
|
||||||
|
|
||||||
(defun exwm-systemtray--on-KeyPress (data _synthetic)
|
(defun exwm-systemtray--on-KeyPress (data _synthetic)
|
||||||
"Forward all KeyPress events to Emacs frame."
|
"Forward all KeyPress events to Emacs frame."
|
||||||
|
(exwm--log)
|
||||||
;; This function is only executed when there's no autohide minibuffer,
|
;; This function is only executed when there's no autohide minibuffer,
|
||||||
;; a workspace frame has the input focus and the pointer is over a
|
;; a workspace frame has the input focus and the pointer is over a
|
||||||
;; tray icon.
|
;; tray icon.
|
||||||
|
@ -325,6 +332,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
|
|
||||||
(defun exwm-systemtray--on-workspace-switch ()
|
(defun exwm-systemtray--on-workspace-switch ()
|
||||||
"Reparent/Refresh the system tray in `exwm-workspace-switch-hook'."
|
"Reparent/Refresh the system tray in `exwm-workspace-switch-hook'."
|
||||||
|
(exwm--log)
|
||||||
(unless (exwm-workspace--minibuffer-own-frame-p)
|
(unless (exwm-workspace--minibuffer-own-frame-p)
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:ReparentWindow
|
(make-instance 'xcb:ReparentWindow
|
||||||
|
@ -339,6 +347,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
|
|
||||||
(defun exwm-systemtray--on-randr-refresh ()
|
(defun exwm-systemtray--on-randr-refresh ()
|
||||||
"Reposition/Refresh the system tray in `exwm-randr-refresh-hook'."
|
"Reposition/Refresh the system tray in `exwm-randr-refresh-hook'."
|
||||||
|
(exwm--log)
|
||||||
(unless (exwm-workspace--minibuffer-own-frame-p)
|
(unless (exwm-workspace--minibuffer-own-frame-p)
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
(make-instance 'xcb:ConfigureWindow
|
(make-instance 'xcb:ConfigureWindow
|
||||||
|
@ -353,6 +362,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
|
|
||||||
(cl-defun exwm-systemtray--init ()
|
(cl-defun exwm-systemtray--init ()
|
||||||
"Initialize system tray module."
|
"Initialize system tray module."
|
||||||
|
(exwm--log)
|
||||||
(cl-assert (not exwm-systemtray--connection))
|
(cl-assert (not exwm-systemtray--connection))
|
||||||
(cl-assert (not exwm-systemtray--list))
|
(cl-assert (not exwm-systemtray--list))
|
||||||
(cl-assert (not exwm-systemtray--selection-owner-window))
|
(cl-assert (not exwm-systemtray--selection-owner-window))
|
||||||
|
@ -493,6 +503,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
|
|
||||||
(defun exwm-systemtray--exit ()
|
(defun exwm-systemtray--exit ()
|
||||||
"Exit the systemtray module."
|
"Exit the systemtray module."
|
||||||
|
(exwm--log)
|
||||||
(when exwm-systemtray--connection
|
(when exwm-systemtray--connection
|
||||||
;; Hide & reparent out the embedder before disconnection to prevent
|
;; Hide & reparent out the embedder before disconnection to prevent
|
||||||
;; embedded icons from being reparented to an Emacs frame (which is the
|
;; embedded icons from being reparented to an Emacs frame (which is the
|
||||||
|
@ -521,6 +532,7 @@ You shall use the default value if using auto-hide minibuffer."
|
||||||
|
|
||||||
(defun exwm-systemtray-enable ()
|
(defun exwm-systemtray-enable ()
|
||||||
"Enable system tray support for EXWM."
|
"Enable system tray support for EXWM."
|
||||||
|
(exwm--log)
|
||||||
(add-hook 'exwm-init-hook #'exwm-systemtray--init)
|
(add-hook 'exwm-init-hook #'exwm-systemtray--init)
|
||||||
(add-hook 'exwm-exit-hook #'exwm-systemtray--exit))
|
(add-hook 'exwm-exit-hook #'exwm-systemtray--exit))
|
||||||
|
|
||||||
|
|
|
@ -307,7 +307,8 @@ NIL if FRAME is not a workspace"
|
||||||
;; Make left/top processed first.
|
;; Make left/top processed first.
|
||||||
(push struts* exwm-workspace--struts)
|
(push struts* exwm-workspace--struts)
|
||||||
(setq exwm-workspace--struts
|
(setq exwm-workspace--struts
|
||||||
(append exwm-workspace--struts (list struts*))))))))))
|
(append exwm-workspace--struts (list struts*))))))))
|
||||||
|
(exwm--log "%s" exwm-workspace--struts)))
|
||||||
|
|
||||||
(defun exwm-workspace--update-workareas ()
|
(defun exwm-workspace--update-workareas ()
|
||||||
"Update `exwm-workspace--workareas'."
|
"Update `exwm-workspace--workareas'."
|
||||||
|
@ -371,6 +372,7 @@ NIL if FRAME is not a workspace"
|
||||||
;; Save the result.
|
;; Save the result.
|
||||||
(setq exwm-workspace--workareas workareas)
|
(setq exwm-workspace--workareas workareas)
|
||||||
(xcb:flush exwm--connection))
|
(xcb:flush exwm--connection))
|
||||||
|
(exwm--log "%s" exwm-workspace--workareas)
|
||||||
(run-hooks 'exwm-workspace--update-workareas-hook))
|
(run-hooks 'exwm-workspace--update-workareas-hook))
|
||||||
|
|
||||||
(defun exwm-workspace--set-active (frame active)
|
(defun exwm-workspace--set-active (frame active)
|
||||||
|
@ -451,7 +453,8 @@ NIL if FRAME is not a workspace"
|
||||||
:window (frame-parameter exwm-workspace--minibuffer
|
:window (frame-parameter exwm-workspace--minibuffer
|
||||||
'exwm-outer-id)
|
'exwm-outer-id)
|
||||||
:value-mask xcb:ConfigWindow:Width
|
:value-mask xcb:ConfigWindow:Width
|
||||||
:width width))))
|
:width width))
|
||||||
|
(exwm--log "y: %s, width: %s" y width)))
|
||||||
|
|
||||||
(defun exwm-workspace--switch-map-nth-prefix (&optional prefix-digits)
|
(defun exwm-workspace--switch-map-nth-prefix (&optional prefix-digits)
|
||||||
"Allow selecting a workspace by number.
|
"Allow selecting a workspace by number.
|
||||||
|
@ -647,6 +650,7 @@ Passing a workspace frame as the first option is for internal use only."
|
||||||
(t 0))))
|
(t 0))))
|
||||||
(unless frame-or-index
|
(unless frame-or-index
|
||||||
(setq frame-or-index 0))
|
(setq frame-or-index 0))
|
||||||
|
(exwm--log "%s" frame-or-index)
|
||||||
(if (or (framep frame-or-index)
|
(if (or (framep frame-or-index)
|
||||||
(< frame-or-index (exwm-workspace--count)))
|
(< frame-or-index (exwm-workspace--count)))
|
||||||
(exwm-workspace-switch frame-or-index)
|
(exwm-workspace-switch frame-or-index)
|
||||||
|
@ -747,6 +751,7 @@ before it."
|
||||||
|
|
||||||
INDEX must not exceed the current number of workspaces."
|
INDEX must not exceed the current number of workspaces."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(exwm--log "%s" index)
|
||||||
(if (and index
|
(if (and index
|
||||||
;; No need to move if it's the last one.
|
;; No need to move if it's the last one.
|
||||||
(< index (exwm-workspace--count)))
|
(< index (exwm-workspace--count)))
|
||||||
|
@ -757,6 +762,7 @@ INDEX must not exceed the current number of workspaces."
|
||||||
(defun exwm-workspace-delete (&optional frame-or-index)
|
(defun exwm-workspace-delete (&optional frame-or-index)
|
||||||
"Delete the workspace FRAME-OR-INDEX."
|
"Delete the workspace FRAME-OR-INDEX."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(exwm--log "%s" frame-or-index)
|
||||||
(when (< 1 (exwm-workspace--count))
|
(when (< 1 (exwm-workspace--count))
|
||||||
(delete-frame
|
(delete-frame
|
||||||
(if frame-or-index
|
(if frame-or-index
|
||||||
|
@ -765,6 +771,7 @@ INDEX must not exceed the current number of workspaces."
|
||||||
|
|
||||||
(defun exwm-workspace--set-desktop (id)
|
(defun exwm-workspace--set-desktop (id)
|
||||||
"Set _NET_WM_DESKTOP for X window ID."
|
"Set _NET_WM_DESKTOP for X window ID."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(with-current-buffer (exwm--id->buffer id)
|
(with-current-buffer (exwm--id->buffer id)
|
||||||
(let ((desktop (exwm-workspace--position exwm--frame)))
|
(let ((desktop (exwm-workspace--position exwm--frame)))
|
||||||
(setq exwm--desktop desktop)
|
(setq exwm--desktop desktop)
|
||||||
|
@ -789,6 +796,7 @@ INDEX must not exceed the current number of workspaces."
|
||||||
(let ((frame (exwm-workspace--workspace-from-frame-or-index frame-or-index))
|
(let ((frame (exwm-workspace--workspace-from-frame-or-index frame-or-index))
|
||||||
old-frame container)
|
old-frame container)
|
||||||
(unless id (setq id (exwm--buffer->id (window-buffer))))
|
(unless id (setq id (exwm--buffer->id (window-buffer))))
|
||||||
|
(exwm--log "Moving #x%x to %s" id frame-or-index)
|
||||||
(with-current-buffer (exwm--id->buffer id)
|
(with-current-buffer (exwm--id->buffer id)
|
||||||
(unless (eq exwm--frame frame)
|
(unless (eq exwm--frame frame)
|
||||||
(unless exwm-workspace-show-all-buffers
|
(unless exwm-workspace-show-all-buffers
|
||||||
|
@ -984,6 +992,7 @@ INDEX must not exceed the current number of workspaces."
|
||||||
|
|
||||||
(defun exwm-workspace--x-create-frame (orig-fun params)
|
(defun exwm-workspace--x-create-frame (orig-fun params)
|
||||||
"Set override-redirect on the frame created by `x-create-frame'."
|
"Set override-redirect on the frame created by `x-create-frame'."
|
||||||
|
(exwm--log)
|
||||||
(let ((frame (funcall orig-fun params)))
|
(let ((frame (funcall orig-fun params)))
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:ChangeWindowAttributes
|
(make-instance 'xcb:ChangeWindowAttributes
|
||||||
|
@ -1005,6 +1014,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
(defun exwm-workspace-attach-minibuffer ()
|
(defun exwm-workspace-attach-minibuffer ()
|
||||||
"Attach the minibuffer so that it always shows."
|
"Attach the minibuffer so that it always shows."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(exwm--log)
|
||||||
(when (and (exwm-workspace--minibuffer-own-frame-p)
|
(when (and (exwm-workspace--minibuffer-own-frame-p)
|
||||||
(not (exwm-workspace--minibuffer-attached-p)))
|
(not (exwm-workspace--minibuffer-attached-p)))
|
||||||
;; Reset the frame size.
|
;; Reset the frame size.
|
||||||
|
@ -1029,6 +1039,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
(defun exwm-workspace-detach-minibuffer ()
|
(defun exwm-workspace-detach-minibuffer ()
|
||||||
"Detach the minibuffer so that it automatically hides."
|
"Detach the minibuffer so that it automatically hides."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(exwm--log)
|
||||||
(when (and (exwm-workspace--minibuffer-own-frame-p)
|
(when (and (exwm-workspace--minibuffer-own-frame-p)
|
||||||
(exwm-workspace--minibuffer-attached-p))
|
(exwm-workspace--minibuffer-attached-p))
|
||||||
(setq exwm-workspace--attached-minibuffer-height 0)
|
(setq exwm-workspace--attached-minibuffer-height 0)
|
||||||
|
@ -1046,6 +1057,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
(defun exwm-workspace-toggle-minibuffer ()
|
(defun exwm-workspace-toggle-minibuffer ()
|
||||||
"Attach the minibuffer if it's detached, or detach it if it's attached."
|
"Attach the minibuffer if it's detached, or detach it if it's attached."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(exwm--log)
|
||||||
(when (exwm-workspace--minibuffer-own-frame-p)
|
(when (exwm-workspace--minibuffer-own-frame-p)
|
||||||
(if (exwm-workspace--minibuffer-attached-p)
|
(if (exwm-workspace--minibuffer-attached-p)
|
||||||
(exwm-workspace-detach-minibuffer)
|
(exwm-workspace-detach-minibuffer)
|
||||||
|
@ -1071,6 +1083,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
(when (and (integerp max-mini-window-height)
|
(when (and (integerp max-mini-window-height)
|
||||||
(> height max-mini-window-height))
|
(> height max-mini-window-height))
|
||||||
(setq height max-mini-window-height))
|
(setq height max-mini-window-height))
|
||||||
|
(exwm--log "%s" height)
|
||||||
(set-frame-height exwm-workspace--minibuffer height))))
|
(set-frame-height exwm-workspace--minibuffer height))))
|
||||||
|
|
||||||
(defun exwm-workspace--on-ConfigureNotify (data _synthetic)
|
(defun exwm-workspace--on-ConfigureNotify (data _synthetic)
|
||||||
|
@ -1081,6 +1094,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
(with-slots (window height) obj
|
(with-slots (window height) obj
|
||||||
(when (eq (frame-parameter exwm-workspace--minibuffer 'exwm-outer-id)
|
(when (eq (frame-parameter exwm-workspace--minibuffer 'exwm-outer-id)
|
||||||
window)
|
window)
|
||||||
|
(exwm--log)
|
||||||
(when (and (floatp max-mini-window-height)
|
(when (and (floatp max-mini-window-height)
|
||||||
(> height (* max-mini-window-height
|
(> height (* max-mini-window-height
|
||||||
(exwm-workspace--current-height))))
|
(exwm-workspace--current-height))))
|
||||||
|
@ -1122,6 +1136,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
|
|
||||||
(defun exwm-workspace--show-minibuffer ()
|
(defun exwm-workspace--show-minibuffer ()
|
||||||
"Show the minibuffer frame."
|
"Show the minibuffer frame."
|
||||||
|
(exwm--log)
|
||||||
;; Cancel pending timer.
|
;; Cancel pending timer.
|
||||||
(when exwm-workspace--display-echo-area-timer
|
(when exwm-workspace--display-echo-area-timer
|
||||||
(cancel-timer exwm-workspace--display-echo-area-timer)
|
(cancel-timer exwm-workspace--display-echo-area-timer)
|
||||||
|
@ -1143,6 +1158,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
|
|
||||||
(defun exwm-workspace--hide-minibuffer ()
|
(defun exwm-workspace--hide-minibuffer ()
|
||||||
"Hide the minibuffer frame."
|
"Hide the minibuffer frame."
|
||||||
|
(exwm--log)
|
||||||
;; Hide the minibuffer frame.
|
;; Hide the minibuffer frame.
|
||||||
(if (exwm-workspace--minibuffer-attached-p)
|
(if (exwm-workspace--minibuffer-attached-p)
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
|
@ -1164,6 +1180,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
|
|
||||||
(defun exwm-workspace--on-minibuffer-setup ()
|
(defun exwm-workspace--on-minibuffer-setup ()
|
||||||
"Run in minibuffer-setup-hook to show the minibuffer and its container."
|
"Run in minibuffer-setup-hook to show the minibuffer and its container."
|
||||||
|
(exwm--log)
|
||||||
(when (and (= 1 (minibuffer-depth))
|
(when (and (= 1 (minibuffer-depth))
|
||||||
(not (exwm-workspace--client-p)))
|
(not (exwm-workspace--client-p)))
|
||||||
(add-hook 'post-command-hook #'exwm-workspace--update-minibuffer-height)
|
(add-hook 'post-command-hook #'exwm-workspace--update-minibuffer-height)
|
||||||
|
@ -1185,6 +1202,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
|
|
||||||
(defun exwm-workspace--on-minibuffer-exit ()
|
(defun exwm-workspace--on-minibuffer-exit ()
|
||||||
"Run in minibuffer-exit-hook to hide the minibuffer container."
|
"Run in minibuffer-exit-hook to hide the minibuffer container."
|
||||||
|
(exwm--log)
|
||||||
(when (and (= 1 (minibuffer-depth))
|
(when (and (= 1 (minibuffer-depth))
|
||||||
(not (exwm-workspace--client-p)))
|
(not (exwm-workspace--client-p)))
|
||||||
(remove-hook 'post-command-hook #'exwm-workspace--update-minibuffer-height)
|
(remove-hook 'post-command-hook #'exwm-workspace--update-minibuffer-height)
|
||||||
|
@ -1216,6 +1234,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
|
|
||||||
(defun exwm-workspace--set-desktop-geometry ()
|
(defun exwm-workspace--set-desktop-geometry ()
|
||||||
"Set _NET_DESKTOP_GEOMETRY."
|
"Set _NET_DESKTOP_GEOMETRY."
|
||||||
|
(exwm--log)
|
||||||
;; We don't support large desktop so it's the same with screen size.
|
;; We don't support large desktop so it's the same with screen size.
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:ewmh:set-_NET_DESKTOP_GEOMETRY
|
(make-instance 'xcb:ewmh:set-_NET_DESKTOP_GEOMETRY
|
||||||
|
@ -1225,6 +1244,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
|
|
||||||
(defun exwm-workspace--add-frame-as-workspace (frame)
|
(defun exwm-workspace--add-frame-as-workspace (frame)
|
||||||
"Configure frame FRAME to be treated as a workspace."
|
"Configure frame FRAME to be treated as a workspace."
|
||||||
|
(exwm--log "%s" frame)
|
||||||
(setq exwm-workspace--list (nconc exwm-workspace--list (list frame)))
|
(setq exwm-workspace--list (nconc exwm-workspace--list (list frame)))
|
||||||
(let ((outer-id (string-to-number (frame-parameter frame
|
(let ((outer-id (string-to-number (frame-parameter frame
|
||||||
'outer-window-id)))
|
'outer-window-id)))
|
||||||
|
@ -1389,6 +1409,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
|
|
||||||
(defun exwm-workspace--update-ewmh-props ()
|
(defun exwm-workspace--update-ewmh-props ()
|
||||||
"Update EWMH properties to match the workspace list."
|
"Update EWMH properties to match the workspace list."
|
||||||
|
(exwm--log)
|
||||||
(let ((num-workspaces (exwm-workspace--count)))
|
(let ((num-workspaces (exwm-workspace--count)))
|
||||||
;; Avoid setting 0 desktops.
|
;; Avoid setting 0 desktops.
|
||||||
(when (= 0 num-workspaces)
|
(when (= 0 num-workspaces)
|
||||||
|
@ -1408,6 +1429,7 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
|
||||||
NEW-X-PARAMETERS is an alist of frame parameters, merged into current
|
NEW-X-PARAMETERS is an alist of frame parameters, merged into current
|
||||||
`window-system-default-frame-alist' for the X Window System. The parameters are
|
`window-system-default-frame-alist' for the X Window System. The parameters are
|
||||||
applied to all subsequently created X frames."
|
applied to all subsequently created X frames."
|
||||||
|
(exwm--log)
|
||||||
;; The parameters are modified in place; take current
|
;; The parameters are modified in place; take current
|
||||||
;; ones or insert a new X-specific list.
|
;; ones or insert a new X-specific list.
|
||||||
(let ((x-parameters (or (assq 'x window-system-default-frame-alist)
|
(let ((x-parameters (or (assq 'x window-system-default-frame-alist)
|
||||||
|
@ -1427,6 +1449,7 @@ applied to all subsequently created X frames."
|
||||||
(interactive "e"))
|
(interactive "e"))
|
||||||
|
|
||||||
(defun exwm-workspace--init-minibuffer-frame ()
|
(defun exwm-workspace--init-minibuffer-frame ()
|
||||||
|
(exwm--log)
|
||||||
;; Initialize workspaces without minibuffers.
|
;; Initialize workspaces without minibuffers.
|
||||||
(setq exwm-workspace--minibuffer
|
(setq exwm-workspace--minibuffer
|
||||||
(make-frame '((window-system . x) (minibuffer . only)
|
(make-frame '((window-system . x) (minibuffer . only)
|
||||||
|
@ -1497,6 +1520,7 @@ applied to all subsequently created X frames."
|
||||||
:test #'equal))
|
:test #'equal))
|
||||||
|
|
||||||
(defun exwm-workspace--exit-minibuffer-frame ()
|
(defun exwm-workspace--exit-minibuffer-frame ()
|
||||||
|
(exwm--log)
|
||||||
;; Only on minibuffer-frame.
|
;; Only on minibuffer-frame.
|
||||||
(remove-hook 'minibuffer-setup-hook #'exwm-workspace--on-minibuffer-setup)
|
(remove-hook 'minibuffer-setup-hook #'exwm-workspace--on-minibuffer-setup)
|
||||||
(remove-hook 'minibuffer-exit-hook #'exwm-workspace--on-minibuffer-exit)
|
(remove-hook 'minibuffer-exit-hook #'exwm-workspace--on-minibuffer-exit)
|
||||||
|
@ -1520,6 +1544,7 @@ applied to all subsequently created X frames."
|
||||||
|
|
||||||
(defun exwm-workspace--init ()
|
(defun exwm-workspace--init ()
|
||||||
"Initialize workspace module."
|
"Initialize workspace module."
|
||||||
|
(exwm--log)
|
||||||
;; Prevent unexpected exit
|
;; Prevent unexpected exit
|
||||||
(setq exwm-workspace--fullscreen-frame-count 0)
|
(setq exwm-workspace--fullscreen-frame-count 0)
|
||||||
(exwm-workspace--modify-all-x-frames-parameters
|
(exwm-workspace--modify-all-x-frames-parameters
|
||||||
|
@ -1584,6 +1609,7 @@ applied to all subsequently created X frames."
|
||||||
|
|
||||||
(defun exwm-workspace--exit ()
|
(defun exwm-workspace--exit ()
|
||||||
"Exit the workspace module."
|
"Exit the workspace module."
|
||||||
|
(exwm--log)
|
||||||
(when (exwm-workspace--minibuffer-own-frame-p)
|
(when (exwm-workspace--minibuffer-own-frame-p)
|
||||||
(exwm-workspace--exit-minibuffer-frame))
|
(exwm-workspace--exit-minibuffer-frame))
|
||||||
(advice-remove 'x-create-frame #'exwm-workspace--x-create-frame)
|
(advice-remove 'x-create-frame #'exwm-workspace--x-create-frame)
|
||||||
|
@ -1618,6 +1644,7 @@ applied to all subsequently created X frames."
|
||||||
|
|
||||||
(defun exwm-workspace--post-init ()
|
(defun exwm-workspace--post-init ()
|
||||||
"The second stage in the initialization of the workspace module."
|
"The second stage in the initialization of the workspace module."
|
||||||
|
(exwm--log)
|
||||||
(when exwm-workspace--client
|
(when exwm-workspace--client
|
||||||
;; Reset the 'fullscreen' frame parameter to make emacsclinet frames
|
;; Reset the 'fullscreen' frame parameter to make emacsclinet frames
|
||||||
;; fullscreen (even without the RandR module enabled).
|
;; fullscreen (even without the RandR module enabled).
|
||||||
|
|
32
exwm.el
32
exwm.el
|
@ -107,6 +107,7 @@
|
||||||
(defun exwm-reset ()
|
(defun exwm-reset ()
|
||||||
"Reset the state of the selected window (non-fullscreen, line-mode, etc)."
|
"Reset the state of the selected window (non-fullscreen, line-mode, etc)."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(exwm--log)
|
||||||
(with-current-buffer (window-buffer)
|
(with-current-buffer (window-buffer)
|
||||||
(when (derived-mode-p 'exwm-mode)
|
(when (derived-mode-p 'exwm-mode)
|
||||||
(when (exwm-layout--fullscreen-p)
|
(when (exwm-layout--fullscreen-p)
|
||||||
|
@ -119,6 +120,7 @@
|
||||||
(defun exwm-restart ()
|
(defun exwm-restart ()
|
||||||
"Restart EXWM."
|
"Restart EXWM."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(exwm--log)
|
||||||
(when (exwm--confirm-kill-emacs "[EXWM] Restart? " 'no-check)
|
(when (exwm--confirm-kill-emacs "[EXWM] Restart? " 'no-check)
|
||||||
(let* ((attr (process-attributes (emacs-pid)))
|
(let* ((attr (process-attributes (emacs-pid)))
|
||||||
(args (cdr (assq 'args attr)))
|
(args (cdr (assq 'args attr)))
|
||||||
|
@ -146,6 +148,7 @@
|
||||||
|
|
||||||
(defun exwm--update-desktop (xwin)
|
(defun exwm--update-desktop (xwin)
|
||||||
"Update _NET_WM_DESKTOP."
|
"Update _NET_WM_DESKTOP."
|
||||||
|
(exwm--log "#x%x" xwin)
|
||||||
(with-current-buffer (exwm--id->buffer xwin)
|
(with-current-buffer (exwm--id->buffer xwin)
|
||||||
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
||||||
(make-instance 'xcb:ewmh:get-_NET_WM_DESKTOP
|
(make-instance 'xcb:ewmh:get-_NET_WM_DESKTOP
|
||||||
|
@ -172,6 +175,7 @@
|
||||||
|
|
||||||
(defun exwm--update-window-type (id &optional force)
|
(defun exwm--update-window-type (id &optional force)
|
||||||
"Update _NET_WM_WINDOW_TYPE."
|
"Update _NET_WM_WINDOW_TYPE."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(with-current-buffer (exwm--id->buffer id)
|
(with-current-buffer (exwm--id->buffer id)
|
||||||
(unless (and exwm-window-type (not force))
|
(unless (and exwm-window-type (not force))
|
||||||
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
||||||
|
@ -182,6 +186,7 @@
|
||||||
|
|
||||||
(defun exwm--update-class (id &optional force)
|
(defun exwm--update-class (id &optional force)
|
||||||
"Update WM_CLASS."
|
"Update WM_CLASS."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(with-current-buffer (exwm--id->buffer id)
|
(with-current-buffer (exwm--id->buffer id)
|
||||||
(unless (and exwm-instance-name exwm-class-name (not force))
|
(unless (and exwm-instance-name exwm-class-name (not force))
|
||||||
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
||||||
|
@ -194,6 +199,7 @@
|
||||||
|
|
||||||
(defun exwm--update-utf8-title (id &optional force)
|
(defun exwm--update-utf8-title (id &optional force)
|
||||||
"Update _NET_WM_NAME."
|
"Update _NET_WM_NAME."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(with-current-buffer (exwm--id->buffer id)
|
(with-current-buffer (exwm--id->buffer id)
|
||||||
(when (or force (not exwm-title))
|
(when (or force (not exwm-title))
|
||||||
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
||||||
|
@ -206,6 +212,7 @@
|
||||||
|
|
||||||
(defun exwm--update-ctext-title (id &optional force)
|
(defun exwm--update-ctext-title (id &optional force)
|
||||||
"Update WM_NAME."
|
"Update WM_NAME."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(with-current-buffer (exwm--id->buffer id)
|
(with-current-buffer (exwm--id->buffer id)
|
||||||
(unless (or exwm--title-is-utf8
|
(unless (or exwm--title-is-utf8
|
||||||
(and exwm-title (not force)))
|
(and exwm-title (not force)))
|
||||||
|
@ -218,11 +225,13 @@
|
||||||
|
|
||||||
(defun exwm--update-title (id)
|
(defun exwm--update-title (id)
|
||||||
"Update _NET_WM_NAME or WM_NAME."
|
"Update _NET_WM_NAME or WM_NAME."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(exwm--update-utf8-title id)
|
(exwm--update-utf8-title id)
|
||||||
(exwm--update-ctext-title id))
|
(exwm--update-ctext-title id))
|
||||||
|
|
||||||
(defun exwm--update-transient-for (id &optional force)
|
(defun exwm--update-transient-for (id &optional force)
|
||||||
"Update WM_TRANSIENT_FOR."
|
"Update WM_TRANSIENT_FOR."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(with-current-buffer (exwm--id->buffer id)
|
(with-current-buffer (exwm--id->buffer id)
|
||||||
(unless (and exwm-transient-for (not force))
|
(unless (and exwm-transient-for (not force))
|
||||||
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
||||||
|
@ -233,6 +242,7 @@
|
||||||
|
|
||||||
(defun exwm--update-normal-hints (id &optional force)
|
(defun exwm--update-normal-hints (id &optional force)
|
||||||
"Update WM_NORMAL_HINTS."
|
"Update WM_NORMAL_HINTS."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(with-current-buffer (exwm--id->buffer id)
|
(with-current-buffer (exwm--id->buffer id)
|
||||||
(unless (and (not force)
|
(unless (and (not force)
|
||||||
(or exwm--normal-hints-x exwm--normal-hints-y
|
(or exwm--normal-hints-x exwm--normal-hints-y
|
||||||
|
@ -280,6 +290,7 @@
|
||||||
|
|
||||||
(defun exwm--update-hints (id &optional force)
|
(defun exwm--update-hints (id &optional force)
|
||||||
"Update WM_HINTS."
|
"Update WM_HINTS."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(with-current-buffer (exwm--id->buffer id)
|
(with-current-buffer (exwm--id->buffer id)
|
||||||
(unless (and (not force) exwm--hints-input exwm--hints-urgency)
|
(unless (and (not force) exwm--hints-input exwm--hints-urgency)
|
||||||
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
||||||
|
@ -301,6 +312,7 @@
|
||||||
|
|
||||||
(defun exwm--update-protocols (id &optional force)
|
(defun exwm--update-protocols (id &optional force)
|
||||||
"Update WM_PROTOCOLS."
|
"Update WM_PROTOCOLS."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(with-current-buffer (exwm--id->buffer id)
|
(with-current-buffer (exwm--id->buffer id)
|
||||||
(unless (and exwm--protocols (not force))
|
(unless (and exwm--protocols (not force))
|
||||||
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
||||||
|
@ -311,6 +323,7 @@
|
||||||
|
|
||||||
(defun exwm--update-struts-legacy (id)
|
(defun exwm--update-struts-legacy (id)
|
||||||
"Update _NET_WM_STRUT."
|
"Update _NET_WM_STRUT."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(let ((pair (assq id exwm-workspace--id-struts-alist))
|
(let ((pair (assq id exwm-workspace--id-struts-alist))
|
||||||
reply struts)
|
reply struts)
|
||||||
(unless (and pair (< 4 (length (cdr pair))))
|
(unless (and pair (< 4 (length (cdr pair))))
|
||||||
|
@ -331,6 +344,7 @@
|
||||||
|
|
||||||
(defun exwm--update-struts-partial (id)
|
(defun exwm--update-struts-partial (id)
|
||||||
"Update _NET_WM_STRUT_PARTIAL."
|
"Update _NET_WM_STRUT_PARTIAL."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
(let ((reply (xcb:+request-unchecked+reply exwm--connection
|
||||||
(make-instance 'xcb:ewmh:get-_NET_WM_STRUT_PARTIAL
|
(make-instance 'xcb:ewmh:get-_NET_WM_STRUT_PARTIAL
|
||||||
:window id)))
|
:window id)))
|
||||||
|
@ -350,6 +364,7 @@
|
||||||
|
|
||||||
(defun exwm--update-struts (id)
|
(defun exwm--update-struts (id)
|
||||||
"Update _NET_WM_STRUT_PARTIAL or _NET_WM_STRUT."
|
"Update _NET_WM_STRUT_PARTIAL or _NET_WM_STRUT."
|
||||||
|
(exwm--log "#x%x" id)
|
||||||
(exwm--update-struts-partial id)
|
(exwm--update-struts-partial id)
|
||||||
(exwm--update-struts-legacy id))
|
(exwm--update-struts-legacy id))
|
||||||
|
|
||||||
|
@ -386,7 +401,8 @@
|
||||||
((= atom xcb:Atom:WM_PROTOCOLS)
|
((= atom xcb:Atom:WM_PROTOCOLS)
|
||||||
(exwm--update-protocols id t))
|
(exwm--update-protocols id t))
|
||||||
((= atom xcb:Atom:_NET_WM_USER_TIME)) ;ignored
|
((= atom xcb:Atom:_NET_WM_USER_TIME)) ;ignored
|
||||||
(t (exwm--log "Unhandled PropertyNotify: %s(%d)"
|
(t
|
||||||
|
(exwm--log "Unhandled: %s(%d)"
|
||||||
(x-get-atom-name atom exwm-workspace--current)
|
(x-get-atom-name atom exwm-workspace--current)
|
||||||
atom)))))))
|
atom)))))))
|
||||||
|
|
||||||
|
@ -534,11 +550,13 @@
|
||||||
(= (elt data 0) xcb:icccm:WM_STATE:IconicState))
|
(= (elt data 0) xcb:icccm:WM_STATE:IconicState))
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(bury-buffer)))))
|
(bury-buffer)))))
|
||||||
(t (exwm--log "Unhandled client message: %s" obj)))))
|
(t
|
||||||
|
(exwm--log "Unhandled: %s(%d)"
|
||||||
|
(x-get-atom-name type exwm-workspace--current) type)))))
|
||||||
|
|
||||||
(defun exwm--on-SelectionClear (data _synthetic)
|
(defun exwm--on-SelectionClear (data _synthetic)
|
||||||
"Handle SelectionClear events."
|
"Handle SelectionClear events."
|
||||||
(exwm--log "SelectionClear")
|
(exwm--log)
|
||||||
(let ((obj (make-instance 'xcb:SelectionClear))
|
(let ((obj (make-instance 'xcb:SelectionClear))
|
||||||
owner selection)
|
owner selection)
|
||||||
(xcb:unmarshal obj data)
|
(xcb:unmarshal obj data)
|
||||||
|
@ -550,6 +568,7 @@
|
||||||
|
|
||||||
(defun exwm--init-icccm-ewmh ()
|
(defun exwm--init-icccm-ewmh ()
|
||||||
"Initialize ICCCM/EWMH support."
|
"Initialize ICCCM/EWMH support."
|
||||||
|
(exwm--log)
|
||||||
;; Handle PropertyNotify event
|
;; Handle PropertyNotify event
|
||||||
(xcb:+event exwm--connection 'xcb:PropertyNotify #'exwm--on-PropertyNotify)
|
(xcb:+event exwm--connection 'xcb:PropertyNotify #'exwm--on-PropertyNotify)
|
||||||
;; Handle relevant client messages
|
;; Handle relevant client messages
|
||||||
|
@ -693,6 +712,7 @@
|
||||||
|
|
||||||
REPLACE specifies what to do in case there already is a window
|
REPLACE specifies what to do in case there already is a window
|
||||||
manager. If t, replace it, if nil, abort and ask the user if `ask'."
|
manager. If t, replace it, if nil, abort and ask the user if `ask'."
|
||||||
|
(exwm--log "%s" replace)
|
||||||
(with-slots (owner)
|
(with-slots (owner)
|
||||||
(xcb:+request-unchecked+reply exwm--connection
|
(xcb:+request-unchecked+reply exwm--connection
|
||||||
(make-instance 'xcb:GetSelectionOwner
|
(make-instance 'xcb:GetSelectionOwner
|
||||||
|
@ -767,6 +787,7 @@ manager. If t, replace it, if nil, abort and ask the user if `ask'."
|
||||||
(cl-defun exwm-init (&optional frame)
|
(cl-defun exwm-init (&optional frame)
|
||||||
"Initialize EXWM."
|
"Initialize EXWM."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(exwm--log "%s" frame)
|
||||||
(if frame
|
(if frame
|
||||||
;; The frame might not be selected if it's created by emacslicnet.
|
;; The frame might not be selected if it's created by emacslicnet.
|
||||||
(select-frame-set-input-focus frame)
|
(select-frame-set-input-focus frame)
|
||||||
|
@ -825,6 +846,7 @@ manager. If t, replace it, if nil, abort and ask the user if `ask'."
|
||||||
(defun exwm-exit ()
|
(defun exwm-exit ()
|
||||||
"Exit EXWM."
|
"Exit EXWM."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(exwm--log)
|
||||||
(run-hooks 'exwm-exit-hook)
|
(run-hooks 'exwm-exit-hook)
|
||||||
(setq confirm-kill-emacs nil)
|
(setq confirm-kill-emacs nil)
|
||||||
;; Exit modules.
|
;; Exit modules.
|
||||||
|
@ -840,6 +862,7 @@ manager. If t, replace it, if nil, abort and ask the user if `ask'."
|
||||||
|
|
||||||
(defun exwm-enable (&optional undo)
|
(defun exwm-enable (&optional undo)
|
||||||
"Enable/Disable EXWM."
|
"Enable/Disable EXWM."
|
||||||
|
(exwm--log "%s" undo)
|
||||||
(pcase undo
|
(pcase undo
|
||||||
(`undo ;prevent reinitialization
|
(`undo ;prevent reinitialization
|
||||||
(remove-hook 'window-setup-hook #'exwm-init)
|
(remove-hook 'window-setup-hook #'exwm-init)
|
||||||
|
@ -866,6 +889,7 @@ manager. If t, replace it, if nil, abort and ask the user if `ask'."
|
||||||
|
|
||||||
(defun exwm--server-stop ()
|
(defun exwm--server-stop ()
|
||||||
"Stop the subordinate Emacs server."
|
"Stop the subordinate Emacs server."
|
||||||
|
(exwm--log)
|
||||||
(server-force-delete exwm--server-name)
|
(server-force-delete exwm--server-name)
|
||||||
(when exwm--server-process
|
(when exwm--server-process
|
||||||
(delete-process exwm--server-process)
|
(delete-process exwm--server-process)
|
||||||
|
@ -874,6 +898,7 @@ manager. If t, replace it, if nil, abort and ask the user if `ask'."
|
||||||
(defun exwm--server-eval-at (&rest args)
|
(defun exwm--server-eval-at (&rest args)
|
||||||
"Wrapper of `server-eval-at' used to advice subrs."
|
"Wrapper of `server-eval-at' used to advice subrs."
|
||||||
;; Start the subordinate Emacs server if it's not alive
|
;; Start the subordinate Emacs server if it's not alive
|
||||||
|
(exwm--log "%s" args)
|
||||||
(unless (server-running-p exwm--server-name)
|
(unless (server-running-p exwm--server-name)
|
||||||
(when exwm--server-process (delete-process exwm--server-process))
|
(when exwm--server-process (delete-process exwm--server-process))
|
||||||
(setq exwm--server-process
|
(setq exwm--server-process
|
||||||
|
@ -912,6 +937,7 @@ manager. If t, replace it, if nil, abort and ask the user if `ask'."
|
||||||
|
|
||||||
(defun exwm--confirm-kill-emacs (prompt &optional force)
|
(defun exwm--confirm-kill-emacs (prompt &optional force)
|
||||||
"Confirm before exiting Emacs."
|
"Confirm before exiting Emacs."
|
||||||
|
(exwm--log)
|
||||||
(when (cond
|
(when (cond
|
||||||
((and force (not (eq force 'no-check)))
|
((and force (not (eq force 'no-check)))
|
||||||
;; Force killing Emacs.
|
;; Force killing Emacs.
|
||||||
|
|
Loading…
Reference in a new issue