mirror of
https://github.com/ch11ng/exwm.git
synced 2024-11-27 13:07:59 +01:00
Fix various stability issues
* exwm-input.el (exwm-input--on-KeyPress-line-mode) (exwm-input--on-KeyPress-char-mode): Append events at the tail. * exwm-manage.el (exwm-manage--unmanage-window): Remove the _NET_WM_DESKTOP property when an X window is withdrawn. * exwm-systemtray.el (exwm-systemtray--init): * exwm-workspace.el (exwm-workspace--confirm-kill-emacs): Issue warning rather than error when there's an existing tray running. * exwm.el (exwm--on-ClientMessage): The buffer window can be on a floating frame.
This commit is contained in:
parent
6c8255bf39
commit
39dc328157
5 changed files with 22 additions and 8 deletions
|
@ -313,7 +313,8 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
|
||||||
(unless minibuffer-window (setq exwm-input--during-key-sequence t))
|
(unless minibuffer-window (setq exwm-input--during-key-sequence t))
|
||||||
;; Feed this event to command loop. Also force it to be added to
|
;; Feed this event to command loop. Also force it to be added to
|
||||||
;; `this-command-keys'.
|
;; `this-command-keys'.
|
||||||
(push (cons t event) unread-command-events))
|
(setq unread-command-events
|
||||||
|
(append unread-command-events `((t . ,event)))))
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:AllowEvents
|
(make-instance 'xcb:AllowEvents
|
||||||
:mode (or mode xcb:Allow:ReplayKeyboard)
|
:mode (or mode xcb:Allow:ReplayKeyboard)
|
||||||
|
@ -336,7 +337,8 @@ It's updated in several occasions, and only used by `exwm-input--set-focus'.")
|
||||||
(setq exwm-input--temp-line-mode t
|
(setq exwm-input--temp-line-mode t
|
||||||
exwm-input--during-key-sequence t)
|
exwm-input--during-key-sequence t)
|
||||||
(exwm-input--grab-keyboard)) ;grab keyboard temporarily
|
(exwm-input--grab-keyboard)) ;grab keyboard temporarily
|
||||||
(push event unread-command-events))))
|
(setq unread-command-events
|
||||||
|
(append unread-command-events (list event))))))
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:AllowEvents
|
(make-instance 'xcb:AllowEvents
|
||||||
:mode xcb:Allow:AsyncKeyboard
|
:mode xcb:Allow:AsyncKeyboard
|
||||||
|
|
|
@ -248,7 +248,11 @@ corresponding buffer.")
|
||||||
(run-hooks 'exwm-manage-finish-hook)))))
|
(run-hooks 'exwm-manage-finish-hook)))))
|
||||||
|
|
||||||
(defun exwm-manage--unmanage-window (id &optional withdraw-only)
|
(defun exwm-manage--unmanage-window (id &optional withdraw-only)
|
||||||
"Unmanage window ID."
|
"Unmanage window ID.
|
||||||
|
|
||||||
|
If WITHDRAW-ONLY is non-nil, the X window will be properly placed back to the
|
||||||
|
root window. Set WITHDRAW-ONLY to 'quit if this functions is used when window
|
||||||
|
manager is shutting down."
|
||||||
(let ((buffer (exwm--id->buffer id)))
|
(let ((buffer (exwm--id->buffer id)))
|
||||||
(exwm--log "Unmanage #x%x (buffer: %s, widthdraw: %s)"
|
(exwm--log "Unmanage #x%x (buffer: %s, widthdraw: %s)"
|
||||||
id buffer withdraw-only)
|
id buffer withdraw-only)
|
||||||
|
@ -295,7 +299,13 @@ corresponding buffer.")
|
||||||
;; Delete WM_STATE property
|
;; Delete WM_STATE property
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:DeleteProperty
|
(make-instance 'xcb:DeleteProperty
|
||||||
:window id :property xcb:Atom:WM_STATE)))
|
:window id :property xcb:Atom:WM_STATE))
|
||||||
|
(unless (eq withdraw-only 'quit)
|
||||||
|
;; Remove _NET_WM_DESKTOP.
|
||||||
|
(xcb:+request exwm--connection
|
||||||
|
(make-instance 'xcb:DeleteProperty
|
||||||
|
:window id
|
||||||
|
:property xcb:Atom:_NET_WM_DESKTOP))))
|
||||||
(when exwm--floating-frame
|
(when exwm--floating-frame
|
||||||
;; Unmap the floating frame before destroying the containers.
|
;; Unmap the floating frame before destroying the containers.
|
||||||
(let ((window (frame-parameter exwm--floating-frame 'exwm-outer-id)))
|
(let ((window (frame-parameter exwm--floating-frame 'exwm-outer-id)))
|
||||||
|
|
|
@ -296,7 +296,7 @@ You shall use the default value if using auto-hide minibuffer.")
|
||||||
(defvar xcb:Atom:_NET_SYSTEM_TRAY_S0)
|
(defvar xcb:Atom:_NET_SYSTEM_TRAY_S0)
|
||||||
(defvar exwm-workspace--minibuffer)
|
(defvar exwm-workspace--minibuffer)
|
||||||
|
|
||||||
(defun exwm-systemtray--init ()
|
(cl-defun exwm-systemtray--init ()
|
||||||
"Initialize system tray module."
|
"Initialize system tray module."
|
||||||
(cl-assert (not exwm-systemtray--connection))
|
(cl-assert (not exwm-systemtray--connection))
|
||||||
(cl-assert (not exwm-systemtray--list))
|
(cl-assert (not exwm-systemtray--list))
|
||||||
|
@ -319,7 +319,9 @@ You shall use the default value if using auto-hide minibuffer.")
|
||||||
(make-instance 'xcb:GetSelectionOwner
|
(make-instance 'xcb:GetSelectionOwner
|
||||||
:selection xcb:Atom:_NET_SYSTEM_TRAY_S0))
|
:selection xcb:Atom:_NET_SYSTEM_TRAY_S0))
|
||||||
(when (/= owner xcb:Window:None)
|
(when (/= owner xcb:Window:None)
|
||||||
(error "[EXWM] Other system tray detected")))
|
(xcb:disconnect exwm-systemtray--connection)
|
||||||
|
(warn "[EXWM] Other system tray detected")
|
||||||
|
(cl-return-from exwm-systemtray--init)))
|
||||||
(let ((id (xcb:generate-id exwm-systemtray--connection)))
|
(let ((id (xcb:generate-id exwm-systemtray--connection)))
|
||||||
(setq exwm-systemtray--selection-owner-window id)
|
(setq exwm-systemtray--selection-owner-window id)
|
||||||
(xcb:+request exwm-systemtray--connection
|
(xcb:+request exwm-systemtray--connection
|
||||||
|
|
|
@ -667,7 +667,7 @@ The optional FORCE option is for internal use only."
|
||||||
x (if (= x 1) "" "s") prompt))))
|
x (if (= x 1) "" "s") prompt))))
|
||||||
;; Unmanage all X windows.
|
;; Unmanage all X windows.
|
||||||
(dolist (i exwm--id-buffer-alist)
|
(dolist (i exwm--id-buffer-alist)
|
||||||
(exwm-manage--unmanage-window (car i) t)
|
(exwm-manage--unmanage-window (car i) 'quit)
|
||||||
(xcb:+request exwm--connection
|
(xcb:+request exwm--connection
|
||||||
(make-instance 'xcb:MapWindow :window (car i))))
|
(make-instance 'xcb:MapWindow :window (car i))))
|
||||||
;; Reparent out the minibuffer frame.
|
;; Reparent out the minibuffer frame.
|
||||||
|
|
2
exwm.el
2
exwm.el
|
@ -327,7 +327,7 @@
|
||||||
(set-window-buffer (frame-selected-window exwm--frame)
|
(set-window-buffer (frame-selected-window exwm--frame)
|
||||||
(current-buffer)))
|
(current-buffer)))
|
||||||
;; Focus transfer.
|
;; Focus transfer.
|
||||||
(select-window (get-buffer-window)))))))
|
(select-window (get-buffer-window nil t)))))))
|
||||||
;; _NET_CLOSE_WINDOW.
|
;; _NET_CLOSE_WINDOW.
|
||||||
((= type xcb:Atom:_NET_CLOSE_WINDOW)
|
((= type xcb:Atom:_NET_CLOSE_WINDOW)
|
||||||
(let ((buffer (exwm--id->buffer id)))
|
(let ((buffer (exwm--id->buffer id)))
|
||||||
|
|
Loading…
Reference in a new issue